]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.cpp
This TODO is implementable now: use real KFileItem instead of fake one
[dolphin.git] / src / dolphinview.cpp
index 4db66cd4bb4ce07921c93ba38a6f5f4b71c4401d..297ab9934267c9464f6217a004f89010ce74134a 100644 (file)
@@ -320,7 +320,13 @@ bool DolphinView::supportsCategorizedSorting() const
 
 void DolphinView::selectAll()
 {
-    itemView()->selectAll();
+    QAbstractItemView* view = itemView();
+    // TODO: there seems to be a bug in QAbstractItemView::selectAll(); if
+    // the Ctrl-key is pressed (e. g. for Ctrl+A), selectAll() inverts the
+    // selection instead of selecting all items. This is bypassed for KDE 4.0
+    // by invoking clearSelection() first.
+    view->clearSelection();
+    view->selectAll();
 }
 
 void DolphinView::invertSelection()
@@ -1203,8 +1209,8 @@ QPair<bool, QString> DolphinView::pasteInfo() const
     }
 
     if (ret.first) {
-        const KUrl::List urls = selectedUrls();
-        const uint count = urls.count();
+        const KFileItemList items = selectedItems();
+        const uint count = items.count();
         if (count > 1) {
             // pasting should not be allowed when more than one file
             // is selected
@@ -1212,13 +1218,7 @@ QPair<bool, QString> DolphinView::pasteInfo() const
         } else if (count == 1) {
             // Only one file is selected. Pasting is only allowed if this
             // file is a directory.
-            // TODO: this doesn't work with remote protocols; instead we need a
-            // m_activeViewContainer->selectedFileItems() to get the real KFileItems
-            const KFileItem fileItem(S_IFDIR,
-                                     KFileItem::Unknown,
-                                     urls.first(),
-                                     true);
-            ret.first = fileItem.isDir();
+            ret.first = items.first().isDir();
         }
     }
     return ret;