X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/a38f83014467f61059fc40b2273d0175e9b3b26d..60d555fa55f025f3ecaa82cf95f012cbbbeb8ddc:/src/dolphinview.cpp diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 8278d136a..f18f6b391 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -329,6 +329,7 @@ void DolphinView::clearSelection() const QModelIndex currentIndex = selModel->currentIndex(); selModel->setCurrentIndex(currentIndex, QItemSelectionModel::Current | QItemSelectionModel::Clear); + m_selectedItems.clear(); } KFileItemList DolphinView::selectedItems() const @@ -375,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) @@ -656,6 +657,10 @@ void DolphinView::renameSelectedItems() return; } delete dialog; + + // the selection would be invalid after renaming the items, so just clear + // it before + clearSelection(); // TODO: check how this can be integrated into KIO::FileUndoManager/KonqOperations // as one operation instead of n rename operations like it is done now...