┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistselectionmanager.cpp
diff options
context:
space:
mode:
authorEmmanuel Pescosta <[email protected]>2014-04-26 13:08:31 +0200
committerEmmanuel Pescosta <[email protected]>2014-04-26 13:08:31 +0200
commit5f29eec07572503679ca1dd354236065f33ff4a7 (patch)
tree3afa3f83e7bb13691774eeb60ac5cc30d0347e49 /src/kitemviews/kitemlistselectionmanager.cpp
parent5e82e598ea941c1f174d8e343feb2008552188a2 (diff)
parentb5ca0e2de9001d2584073c043c1fbc1921e0174d (diff)
Merge branch 'KDE/4.13' of git://anongit.kde.org/kde-baseapps into KDE/4.13
Diffstat (limited to 'src/kitemviews/kitemlistselectionmanager.cpp')
-rw-r--r--src/kitemviews/kitemlistselectionmanager.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/kitemviews/kitemlistselectionmanager.cpp b/src/kitemviews/kitemlistselectionmanager.cpp
index ebff1a30e..1f0a89d06 100644
--- a/src/kitemviews/kitemlistselectionmanager.cpp
+++ b/src/kitemviews/kitemlistselectionmanager.cpp
@@ -331,6 +331,11 @@ void KItemListSelectionManager::itemsMoved(const KItemRange& itemRange, const QL
// Store the current selection (needed in the selectionChanged() signal)
const KItemSet previousSelection = selectedItems();
+ // endAnchoredSelection() adds all items between m_currentItem and
+ // m_anchorItem to m_selectedItems. They can then be moved
+ // individually later in this function.
+ endAnchoredSelection();
+
// Update the current item
if (m_currentItem >= itemRange.index && m_currentItem < itemRange.index + itemRange.count) {
const int previousCurrentItem = m_currentItem;
@@ -342,10 +347,8 @@ void KItemListSelectionManager::itemsMoved(const KItemRange& itemRange, const QL
emit currentChanged(newCurrentItem, previousCurrentItem);
}
- // Update the anchor item
- if (m_anchorItem >= itemRange.index && m_anchorItem < itemRange.index + itemRange.count) {
- m_anchorItem = movedToIndexes.at(m_anchorItem - itemRange.index);
- }
+ // Start a new anchored selection.
+ beginAnchoredSelection(m_currentItem);
// Update the selections
if (!m_selectedItems.isEmpty()) {