┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphindetailsview.cpp
diff options
context:
space:
mode:
authorSimon Paul St James <[email protected]>2008-10-27 21:49:16 +0000
committerSimon Paul St James <[email protected]>2008-10-27 21:49:16 +0000
commita124b15cfec8da4c16b9c8588bb69a00772a0566 (patch)
treec903e4188c41f663b373d0a812da9b183a8f55ce /src/dolphindetailsview.cpp
parentad647bd0a050a54a2db4c15e363d2f0143f6d34e (diff)
Sometimes, the penultimate item in the bounds would get deselected when it shouldn't - this is because lastIndex is always included in the toggle range, even if it needn't be toggled. Fixed now - hopefully, there are no more "elastic band selection" bugs, now :)
svn path=/trunk/KDE/kdebase/apps/; revision=876724
Diffstat (limited to 'src/dolphindetailsview.cpp')
-rw-r--r--src/dolphindetailsview.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp
index a40e6236d..efdead0c7 100644
--- a/src/dolphindetailsview.cpp
+++ b/src/dolphindetailsview.cpp
@@ -742,7 +742,7 @@ void DolphinDetailsView::updateElasticBandSelection()
do {
QRect currIndexRect = visualRect(currIndex);
- const QString name = m_controller->itemForIndex(currIndex).name();
+ const QString name = m_controller->itemForIndex(currIndex).name();
currIndexRect.setWidth(DolphinFileItemDelegate::nameColumnWidth(name, viewOptions()));
// Update some optimisation info as we go.
@@ -783,10 +783,20 @@ void DolphinDetailsView::updateElasticBandSelection()
allItemsInBoundDone ||
currIndex.parent() != toggleIndexRangeBegin.parent());
if (commitToggleIndexRange) {
- itemsToToggle.select(toggleIndexRangeBegin, lastIndex );
- // Immediately start a new range with currIndex?
- if (needToToggleItem) {
- toggleIndexRangeBegin = currIndex;
+ if (!allItemsInBoundDone) {
+ 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);
+ }
}
formingToggleIndexRange = needToToggleItem;
}