X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/35a0eca331f475e2751614f782c2710fc93cfebd..c3ffc95a7356cdb428aa68f0fbfb0db9c6dcf5b5:/src/dolphinview.cpp diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 06805eefc..d4dbbd2c2 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -376,7 +376,7 @@ int DolphinView::selectedItemsCount() const return m_columnView->selectedItems().count(); } - return itemView()->selectionModel()->selection().count(); + return itemView()->selectionModel()->selectedIndexes().count(); } void DolphinView::setContentsPosition(int x, int y) @@ -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(); }