[Digikam-devel] [digikam] [Bug 331597] Tags are not sorted in UI [patch]

Gilles Caulier caulier.gilles at gmail.com
Thu May 8 06:27:28 BST 2014


https://bugs.kde.org/show_bug.cgi?id=331597

--- Comment #21 from Gilles Caulier <caulier.gilles at gmail.com> ---
Git commit fa2ae1d7254c3b08e1a94d840aac06623722752e by Mohamed Anwer.
Committed on 08/05/2014 at 03:16.
Pushed by mohamedanwer into branch 'master'.

Removing magic number and polish

M  +4    -3    libs/models/albumfiltermodel.cpp

http://commits.kde.org/digikam/fa2ae1d7254c3b08e1a94d840aac06623722752e

diff --git a/libs/models/albumfiltermodel.cpp
b/libs/models/albumfiltermodel.cpp
index d095a90..42b43d7 100644
--- a/libs/models/albumfiltermodel.cpp
+++ b/libs/models/albumfiltermodel.cpp
@@ -342,15 +342,16 @@ bool AlbumFilterModel::lessThan(const QModelIndex& left,
const QModelIndex& righ
     QVariant valRight = right.data(sortRole());

     AlbumSettings::AlbumSortOrder sortRole =
AlbumSettings::instance()->getAlbumSortOrder();
+    AlbumSettings::StringComparisonType strComparisonType =
AlbumSettings::instance()->getStringComparisonType();

     if (leftAlbum && rightAlbum)
     {
-        if(leftAlbum->type() == 0 && rightAlbum->type()== 0)//checking for
PAlbums
+        if(leftAlbum->type() == Album::PHYSICAL && rightAlbum->type()==
Album::PHYSICAL)
         {
             switch (sortRole)
             {
                 case AlbumSettings::ByFolder:
-                    switch
(AlbumSettings::instance()->getStringComparisonType())
+                    switch (strComparisonType)
                     {
                         case AlbumSettings::Natural:
                             return
KStringHandler::naturalCompare(leftAlbum->title(), rightAlbum->title(),
sortCaseSensitivity()) < 0;
@@ -369,7 +370,7 @@ bool AlbumFilterModel::lessThan(const QModelIndex& left,
const QModelIndex& righ
         {
             if((valLeft.type() == QVariant::String) && (valRight.type() ==
QVariant::String))
             {
-                switch (AlbumSettings::instance()->getStringComparisonType())
+                switch (strComparisonType)
                 {
                     case AlbumSettings::Natural:
                         return
KStringHandler::naturalCompare(valLeft.toString(), valRight.toString(),
sortCaseSensitivity()) < 0;

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Digikam-devel mailing list