diff options
| author | Rafael Fernández López <[email protected]> | 2007-06-17 18:23:53 +0000 |
|---|---|---|
| committer | Rafael Fernández López <[email protected]> | 2007-06-17 18:23:53 +0000 |
| commit | 4d91d82f115f80137face43b29603c4a8124cc8f (patch) | |
| tree | f6fc30ba36e005852437a3b874df19784fbf080d | |
| parent | 7b6f191dc31517757719ffe51fd427b14e6ed710 (diff) | |
If our folders or files have the same number of items or size, sort them
CORRECTLY by their names :)
svn path=/trunk/KDE/kdebase/apps/; revision=676792
| -rw-r--r-- | src/dolphinsortfilterproxymodel.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dolphinsortfilterproxymodel.cpp b/src/dolphinsortfilterproxymodel.cpp index 170c116d7..4097cbe9d 100644 --- a/src/dolphinsortfilterproxymodel.cpp +++ b/src/dolphinsortfilterproxymodel.cpp @@ -216,8 +216,8 @@ bool DolphinSortFilterProxyModel::lessThan(const QModelIndex& left, // their names. So we have always everything ordered. We also check // if we are taking in count their cases if (leftCount == rightCount) { - const QString leftStr = leftData.toString(); - const QString rightStr = rightData.toString(); + const QString leftStr = dirModel->data(left, DolphinView::SortByName).toString(); + const QString rightStr = dirModel->data(right, DolphinView::SortByName).toString(); return sortCaseSensitivity() ? (naturalCompare(leftStr, rightStr) < 0) : (naturalCompare(leftStr.toLower(), rightStr.toLower()) < 0); @@ -231,8 +231,8 @@ bool DolphinSortFilterProxyModel::lessThan(const QModelIndex& left, // If what we are measuring is two files and they have the same size, // sort them by their file names if (leftFileItem->size() == rightFileItem->size()) { - const QString leftStr = leftData.toString(); - const QString rightStr = rightData.toString(); + const QString leftStr = dirModel->data(left, DolphinView::SortByName).toString(); + const QString rightStr = dirModel->data(right, DolphinView::SortByName).toString(); return sortCaseSensitivity() ? (naturalCompare(leftStr, rightStr) < 0) : (naturalCompare(leftStr.toLower(), rightStr.toLower()) < 0); |
