diff options
| author | Simon Paul St James <[email protected]> | 2008-10-27 21:49:16 +0000 |
|---|---|---|
| committer | Simon Paul St James <[email protected]> | 2008-10-27 21:49:16 +0000 |
| commit | a124b15cfec8da4c16b9c8588bb69a00772a0566 (patch) | |
| tree | c903e4188c41f663b373d0a812da9b183a8f55ce /src/dolphindetailsview.cpp | |
| parent | ad647bd0a050a54a2db4c15e363d2f0143f6d34e (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.cpp | 20 |
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; } |
