[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/korganizer/views/todoview
From:       Sergio Luis Martins <iamsergio () gmail ! com>
Date:       2009-06-04 20:00:21
Message-ID: 1244145621.643107.16549.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 977606 by smartins:

While sorting, "Unspecified" priority must be treated as a low priority.

BUG: 173079


 M  +9 -0      kotodoviewsortfilterproxymodel.cpp  


--- trunk/KDE/kdepim/korganizer/views/todoview/kotodoviewsortfilterproxymodel.cpp #977605:977606
@@ -94,6 +94,15 @@
     if ( leftIsEmpty || rightIsEmpty ) {
       return rightIsEmpty;
     }
+  } else if ( right.column() == KOTodoModel::PriorityColumn ) {
+    bool leftIsString   = sourceModel()->data( left  ).type() == QVariant::String;
+    bool rightIsString  = sourceModel()->data( right ).type() == QVariant::String;
+
+    // unspecified priority is a low priority, so, if we don't have two QVariant:Ints
+    // we return true if right is a string
+    if ( leftIsString || rightIsString ) {
+      return rightIsString;
+    }
   }
 
   return QSortFilterProxyModel::lessThan( left, right );
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic