]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Performance improvement when selecting pasted/dropped items.
authorPeter Penz <peter.penz19@gmail.com>
Wed, 8 Jul 2009 22:34:02 +0000 (22:34 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 8 Jul 2009 22:34:02 +0000 (22:34 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=993585

src/dolphinview.cpp

index f18f6b3918acc203d649a4d8ccd47d55ac9e98f0..d4dbbd2c28b6eb4fb64132e00ef220d158b2681a 100644 (file)
@@ -1216,16 +1216,17 @@ void DolphinView::slotDirListerCompleted()
     if (!m_newFileNames.isEmpty()) {
         // select all newly added items created by a paste operation or
         // a drag & drop operation
-        QItemSelectionModel* selectionModel = itemView()->selectionModel();
         const int rowCount = m_proxyModel->rowCount();
+        QItemSelection selection;
         for (int row = 0; row < rowCount; ++row) {
             const QModelIndex proxyIndex = m_proxyModel->index(row, 0);
             const QModelIndex dirIndex = m_proxyModel->mapToSource(proxyIndex);
             const KUrl url = m_dolphinModel->itemForIndex(dirIndex).url();
             if (m_newFileNames.contains(url.fileName())) {
-                selectionModel->select(proxyIndex, QItemSelectionModel::Select);
+                selection.merge(QItemSelection(proxyIndex, proxyIndex), QItemSelectionModel::Select);
             }
         }
+        itemView()->selectionModel()->select(selection, QItemSelectionModel::Select);
 
         m_newFileNames.clear();
     }