diff options
| author | Peter Penz <[email protected]> | 2011-12-30 00:02:17 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-12-30 00:08:37 +0100 |
| commit | acee6d0fc59e1c1c5e1d842620245ee3d1e514b7 (patch) | |
| tree | 2b3d5e943a307ef5c93c6ad623b5482f22306b69 /src/kitemviews/kitemlistselectionmanager.h | |
| parent | d7a803cae025c0d5adcf70ddf256fbcc8140827e (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; |
