From cae90c168ebf8e81f5bb8569f6a4d15156923196 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 24 Aug 2011 22:36:05 +0200 Subject: Fix issues with the anchor selection Don't change the selection if the anchor is invalid. This fixes the issue that items might get selected during changing a directory. --- src/kitemviews/kitemlistselectionmanager.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/kitemviews/kitemlistselectionmanager.h') diff --git a/src/kitemviews/kitemlistselectionmanager.h b/src/kitemviews/kitemlistselectionmanager.h index dd4c3e4fc..f8c33bb79 100644 --- a/src/kitemviews/kitemlistselectionmanager.h +++ b/src/kitemviews/kitemlistselectionmanager.h @@ -61,11 +61,17 @@ public: void beginAnchoredSelection(int anchor); void endAnchoredSelection(); + + /** + * Sets the anchor to \a anchor and emits anchorChanged() if the + * anchor differs from the current anchor value. If no anchor selection is active (see + * KItemListSelectionManager::beginAnchoredSelection()) or the index + * is not within the available model items the anchor will not be modified. + */ void setAnchorItem(int anchor); int anchorItem() const; bool isAnchoredSelectionActive() const; - void setAnchoredSelectionActive(bool active); KItemModelBase* model() const; -- cgit v1.3.1