]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix descending sort order issue
authorPeter Penz <peter.penz19@gmail.com>
Wed, 14 Dec 2011 23:22:48 +0000 (00:22 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 14 Dec 2011 23:24:33 +0000 (00:24 +0100)
If the sort order is descending and directories and files are
shown on the same hierarchy level, the sorting was partly wrong.

src/kitemviews/kfileitemmodel.cpp

index 04e3c8ca7c378a60efcdff29add2683705d98d7e..e3b61d47597e697772c627668039ae8b7daff430 100644 (file)
@@ -1484,9 +1484,9 @@ int KFileItemModel::expansionLevelsCompare(const ItemData* a, const ItemData* b)
     const QString subPathB = subPath(b->item, pathB, index, &isDirB);
 
     if (isDirA && !isDirB) {
-        return -1;
+        return (sortOrder() == Qt::AscendingOrder) ? -1 : +1;
     } else if (!isDirA && isDirB) {
-        return +1;
+        return (sortOrder() == Qt::AscendingOrder) ? +1 : -1;
     }
 
     // Compare the items of the parents that represent the first