From: Rafael Fernández López Date: Mon, 18 Jun 2007 12:44:00 +0000 (+0000) Subject: Fix small problem when building categories and sorting by name. Better readable code. X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/ab8abd14a4dfbe46ab1d6fac094b14d6ba4416f6 Fix small problem when building categories and sorting by name. Better readable code. svn path=/trunk/KDE/kdebase/apps/; revision=677087 --- 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;