┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphindetailsview.cpp
diff options
context:
space:
mode:
authorSimon Paul St James <[email protected]>2008-10-28 19:47:31 +0000
committerSimon Paul St James <[email protected]>2008-10-28 19:47:31 +0000
commit76376eb22dd1f6414b98ceda142349ec0903a483 (patch)
tree8648d892b1392c67b880f7cf148c3b3686acdf30 /src/dolphindetailsview.cpp
parent6e41855512e023168efccbbebccc4f3203aa14e9 (diff)
Yet more corner cases in commitToggleIndexRange - include them, and refactor to make things a bit more logical.
svn path=/trunk/KDE/kdebase/apps/; revision=877164
Diffstat (limited to 'src/dolphindetailsview.cpp')
-rw-r--r--src/dolphindetailsview.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp
index f21f6ed66..6d9038b46 100644
--- a/src/dolphindetailsview.cpp
+++ b/src/dolphindetailsview.cpp
@@ -786,22 +786,21 @@ void DolphinDetailsView::updateElasticBandSelection()
allItemsInBoundDone ||
currIndex.parent() != toggleIndexRangeBegin.parent());
if (commitToggleIndexRange) {
- if (!allItemsInBoundDone) {
+ formingToggleIndexRange = false;
+ // If this is the last item in the bounds and it is also the beginning of a range,
+ // don't toggle lastIndex - it will already have been dealt with.
+ if (!allItemsInBoundDone || toggleIndexRangeBegin != currIndex) {
itemsToToggle.select(toggleIndexRangeBegin, lastIndex);
- // Need to start a new range immediately with currIndex?
- if (needToToggleItem)
- toggleIndexRangeBegin = currIndex;
}
- else {
- // Final item in the bounds. Is it also the beginning of a range?
- if (toggleIndexRangeBegin == currIndex) {
- itemsToToggle.select(currIndex, currIndex);
- }
- else {
- itemsToToggle.select(toggleIndexRangeBegin, lastIndex);
- }
+ // Need to start a new range immediately with currIndex?
+ if (needToToggleItem) {
+ toggleIndexRangeBegin = currIndex;
+ formingToggleIndexRange = true;
+ }
+ if (allItemsInBoundDone && needToToggleItem) {
+ // Toggle the very last item in the bounds.
+ itemsToToggle.select(currIndex, currIndex);
}
- formingToggleIndexRange = needToToggleItem;
}
// next item