diff options
| author | Peter Penz <[email protected]> | 2011-12-15 00:22:48 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-12-15 00:24:33 +0100 |
| commit | 065244fac9c581379d62a7ca12c4e9ce4a39af9b (patch) | |
| tree | 3a6f01291b2d540eef91b959cb25bb372025b216 | |
| parent | 756c648f62d03749fe464e6bb0b3d3595a4ced99 (diff) | |
Fix descending sort order issue
If the sort order is descending and directories and files are
shown on the same hierarchy level, the sorting was partly wrong.
| -rw-r--r-- | src/kitemviews/kfileitemmodel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 04e3c8ca7..e3b61d475 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -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 |
