diff options
| author | Peter Penz <[email protected]> | 2011-12-30 00:02:17 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-12-30 00:09:42 +0100 |
| commit | 7953913c9f4223c726a34178cd69010dfaea3f58 (patch) | |
| tree | 2c719f90ff17b988569379db5c5b456093ac7830 /src/kitemviews/kitemlistselectionmanager.h | |
| parent | dec1a1b29d3a384a92163d0a97f8e65e1a0082e3 (diff) | |
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
Diffstat (limited to 'src/kitemviews/kitemlistselectionmanager.h')
| -rw-r--r-- | src/kitemviews/kitemlistselectionmanager.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistselectionmanager.h b/src/kitemviews/kitemlistselectionmanager.h index 82ae13abb..4afad1f8b 100644 --- a/src/kitemviews/kitemlistselectionmanager.h +++ b/src/kitemviews/kitemlistselectionmanager.h @@ -76,6 +76,13 @@ private: void itemsRemoved(const KItemRangeList& itemRanges); void itemsMoved(const KItemRange& itemRange, const QList<int>& movedToIndexes); + + /** + * Helper method for itemsRemoved. Returns the changed index after removing + * the given range. If the index is part of the range, -1 will be returned. + */ + int indexAfterRangesRemoving(int index, const KItemRangeList& itemRanges) const; + private: int m_currentItem; int m_anchorItem; |
