]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Sort the items in DolphinView::selectedItems()
authorFrank Reininghaus <frank78ac@googlemail.com>
Sun, 16 Oct 2011 18:39:34 +0000 (20:39 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Sun, 16 Oct 2011 18:39:34 +0000 (20:39 +0200)
Before this commit, the order of the items in the list returned by
DolphinView::selectedItems() was random. Now the items are sorted like
they are sorted in the view.
BUG: 283409

src/views/dolphinview.cpp

index 871de946b95581ef004d00e9de582d557ed7cb10..122c18de785ad13df17b9bed3dd689d1c8fd1003 100644 (file)
@@ -339,6 +339,9 @@ KFileItemList DolphinView::selectedItems() const
     const KItemListSelectionManager* selectionManager = m_container->controller()->selectionManager();
     const QSet<int> selectedIndexes = selectionManager->selectedItems();
 
+    QList<int> sortedIndexes = selectedIndexes.toList();
+    qSort(sortedIndexes);
+
     KFileItemList selectedItems;
     QSetIterator<int> it(selectedIndexes);
     while (it.hasNext()) {