┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-07-08 22:34:02 +0000
committerPeter Penz <[email protected]>2009-07-08 22:34:02 +0000
commit31d359323c758651bdc51f06017175da32d8bf42 (patch)
tree8016da2dd85cba8156801a62fbb1357f15eda004 /src
parent7c539fd12f5decbfafbea5fa4c317e7c4d753691 (diff)
Performance improvement when selecting pasted/dropped items.
svn path=/trunk/KDE/kdebase/apps/; revision=993585
Diffstat (limited to 'src')
-rw-r--r--src/dolphinview.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index f18f6b391..d4dbbd2c2 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -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();
}