┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRafael Fernández López <[email protected]>2007-06-18 12:44:00 +0000
committerRafael Fernández López <[email protected]>2007-06-18 12:44:00 +0000
commitab8abd14a4dfbe46ab1d6fac094b14d6ba4416f6 (patch)
treeeb02e8addf3efb73a2f7813cdfa715fd05fb2e80 /src
parent41a8be4de41ed84345f9081fc8eedf970d656559 (diff)
Fix small problem when building categories and sorting by name. Better readable code.
svn path=/trunk/KDE/kdebase/apps/; revision=677087
Diffstat (limited to 'src')
-rw-r--r--src/dolphinsortfilterproxymodel.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dolphinsortfilterproxymodel.cpp b/src/dolphinsortfilterproxymodel.cpp
index 598705d13..891626c36 100644
--- a/src/dolphinsortfilterproxymodel.cpp
+++ b/src/dolphinsortfilterproxymodel.cpp
@@ -122,12 +122,15 @@ bool DolphinSortFilterProxyModel::lessThanGeneralPurpose(const QModelIndex &left
const KFileItem *rightFileItem = dirModel->itemForIndex(right);
if (sortRole() == DolphinView::SortByName) { // If we are sorting by name
- const QVariant leftData = dirModel->data(left, sortRole());
- const QVariant rightData = dirModel->data(right, sortRole());
+ const QVariant leftData = dirModel->data(left, KDirModel::Name);
+ const QVariant rightData = dirModel->data(right, KDirModel::Name);
QString leftStr = leftData.toString();
QString rightStr = rightData.toString();
+ leftStr = leftStr.at(0) == '.' ? leftStr.mid(1) : leftStr;
+ rightStr = rightStr.at(0) == '.' ? rightStr.mid(1) : rightStr;
+
// We don't care about case for building categories. We also don't
// want here to compare by a natural comparation
return QString::compare(leftStr, rightStr, Qt::CaseInsensitive) < 0;