]> cloud.milkyroute.net Git - dolphin.git/commitdiff
More logic fixes
authorRafael Fernández López <ereslibre@kde.org>
Mon, 3 Dec 2007 19:43:11 +0000 (19:43 +0000)
committerRafael Fernández López <ereslibre@kde.org>
Mon, 3 Dec 2007 19:43:11 +0000 (19:43 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=744490

src/dolphinsortfilterproxymodel.cpp

index ed84ef8f6861e46a5d6a0ea954ee24cc45adfe23..95fb3854d7f516c4ca89e70f14b890857351e982 100644 (file)
@@ -105,9 +105,9 @@ int DolphinSortFilterProxyModel::compareCategories(const QModelIndex &left,
     switch (left.column()) {
 
     case DolphinView::SortByRating: {
-        const quint32 leftRating = DolphinModel::ratingForIndex(left);
-        const quint32 rightRating = DolphinModel::ratingForIndex(right);
-        return leftRating > rightRating;
+        const qint32 leftRating = DolphinModel::ratingForIndex(left);
+        const qint32 rightRating = DolphinModel::ratingForIndex(right);
+        return leftRating - rightRating;
     }
 
     case DolphinView::SortByTags: {
@@ -115,9 +115,9 @@ int DolphinSortFilterProxyModel::compareCategories(const QModelIndex &left,
         const QString rightTags = DolphinModel::tagsForIndex(right);
 
         if (leftTags.isEmpty() && !rightTags.isEmpty())
-            return false;
+            return -1;
         else if (!leftTags.isEmpty() && rightTags.isEmpty())
-            return true;
+            return 1;
 
         return naturalCompare(DolphinModel::tagsForIndex(left), DolphinModel::tagsForIndex(right)) < 0;
     }