diff options
Diffstat (limited to 'src/kitemviews/kfileitemmodel.cpp')
| -rw-r--r-- | src/kitemviews/kfileitemmodel.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 4b9f2f00e..49c40eda1 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -1564,10 +1564,12 @@ int KFileItemModel::expandedParentsCountCompare(const ItemData* a, const ItemDat bool isDirB = true; const QString subPathB = subPath(b->item, pathB, index, &isDirB); - if (isDirA && !isDirB) { - return (sortOrder() == Qt::AscendingOrder) ? -1 : +1; - } else if (!isDirA && isDirB) { - return (sortOrder() == Qt::AscendingOrder) ? +1 : -1; + if (m_sortFoldersFirst || m_sortRole == SizeRole) { + if (isDirA && !isDirB) { + return (sortOrder() == Qt::AscendingOrder) ? -1 : +1; + } else if (!isDirA && isDirB) { + return (sortOrder() == Qt::AscendingOrder) ? +1 : -1; + } } // Compare the items of the parents that represent the first |
