From acee6d0fc59e1c1c5e1d842620245ee3d1e514b7 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 30 Dec 2011 00:02:17 +0100 Subject: Fix inconsistency in selection manager When a selection has been done with non-linear ranges, it was possible that the anchor item pointed to an invalid index that resulted into an invalid selection. As part of this fix the sorting for DolphinView::selectedItems() has been disabled (if the caller assumes a sorted selection he must manually adjust it). BUG: 288908 FIXED-IN: 4.8.0 --- src/views/dolphinview.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/views/dolphinview.cpp') diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index f17749b83..a31bf566d 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -311,11 +311,8 @@ KFileItemList DolphinView::selectedItems() const const KItemListSelectionManager* selectionManager = m_container->controller()->selectionManager(); const QSet selectedIndexes = selectionManager->selectedItems(); - QList sortedIndexes = selectedIndexes.toList(); - qSort(sortedIndexes); - KFileItemList selectedItems; - QListIterator it(sortedIndexes); + QSetIterator it(selectedIndexes); while (it.hasNext()) { const int index = it.next(); selectedItems.append(model->fileItem(index)); -- cgit v1.3