]> cloud.milkyroute.net Git - dolphin.git/commitdiff
(Un)selections working properly
authorRafael Fernández López <ereslibre@kde.org>
Tue, 18 Sep 2007 05:33:34 +0000 (05:33 +0000)
committerRafael Fernández López <ereslibre@kde.org>
Tue, 18 Sep 2007 05:33:34 +0000 (05:33 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=713803

src/kcategorizedview.cpp

index 026f56c2437a1f62ea1b5f41f15fe47ab3747e14..e88e6a383f874b1ec572f8f4f5ad8d905420b9f3 100644 (file)
@@ -816,13 +816,12 @@ void KCategorizedView::setSelection(const QRect &rect,
             selection << QItemSelectionRange(first, last);
     }
 
-    if (d->lastSelection.count() && !d->mouseButtonPressed)
+    if (d->lastSelection.count())
     {
-        selection.merge(d->lastSelection, flags);
-    }
-    else if (d->lastSelection.count())
-    {
-        selection.merge(d->lastSelection, QItemSelectionModel::Select);
+        if ((selection.count() == 1) && (selection[0].indexes().count() == 1))
+            selection.merge(d->lastSelection, flags);
+        else
+            selection.merge(d->lastSelection, QItemSelectionModel::Select);
     }
 
     selectionModel()->select(selection, flags);