Bug 300788 - Weird Ctrl+Shift selection behavior, it ignores last selected item that's under mouse pointer
Summary: Weird Ctrl+Shift selection behavior, it ignores last selected item that's un...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: general (show other bugs)
Version: 2.0.95
Platform: Mageia RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Peter Penz
URL:
Keywords: regression, reproducible
Depends on:
Blocks:
 
Reported: 2012-05-29 00:44 UTC by linnets
Modified: 2012-06-03 21:07 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.9.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description linnets 2012-05-29 00:44:50 UTC
Use Ctrl+Shift to select files/folders but the last selected files/folders is ignored (not highlight)

Reproducible: Always

Steps to Reproduce:
1. Select a file/folder
2. Hold down Ctrl+Shift and use mouse to select another file/folder

Actual Results:  
All files/folders between the first selected item (include this item) and the last selected item are highlight.
The last selected item is not highlight, only marked.

Expected Results:  
All files/folders between the first and the last selected file/folder (include these two file/folder) are highlight.
Comment 1 Frank Reininghaus 2012-05-30 20:03:00 UTC
Thanks for the report. Just out of curiosity, why do you actually use Ctrl+Shift+Click? The standard way to select all items between the current one and another one is to just Shift+Click the other one.
Comment 2 Frank Reininghaus 2012-05-30 20:28:22 UTC
It seems that in QAbstractItemView (which was used in Dolphin in KDE <= 4.7), Ctrl+Shift+Click is basically equivalent to Shift+Click, so we should probably restore that behaviour. I think that the single-line change below does it, but I feel a little uncomfortable committing that just one day before KDE 4.8.4 gets tagged. Any small change in this area can cause very annoying regressions, and this should better get more testing.

--- a/dolphin/src/kitemviews/kitemlistcontroller.cpp
+++ b/dolphin/src/kitemviews/kitemlistcontroller.cpp
@@ -535,7 +535,7 @@ bool KItemListController::mousePressEvent(QGraphicsSceneMouseEvent* event, const
             break;
 
         case MultiSelection:
-            if (controlPressed) {
+            if (controlPressed && !shiftPressed) {
                 m_selectionManager->setSelected(m_pressedIndex, 1, KItemListSelectionManager::Toggle);
                 m_selectionManager->beginAnchoredSelection(m_pressedIndex);
             } else if (!shiftPressed || !m_selectionManager->isAnchoredSelectionActive()) {
Comment 3 Peter Penz 2012-05-31 09:03:36 UTC
Thanks Frank for the patch. Please just push it to master and not 4.8.4 - lets get this patch tested by users out there before, although the code looks really trivial ;-)
Comment 4 linnets 2012-05-31 20:56:49 UTC
It's just my habit (and, it's convenient not to release/press Ctrl frequently when I want to select several groups of files/folders) :)

(In reply to comment #1)
> Thanks for the report. Just out of curiosity, why do you actually use
> Ctrl+Shift+Click? The standard way to select all items between the current
> one and another one is to just Shift+Click the other one.
Comment 5 Frank Reininghaus 2012-06-03 21:07:31 UTC
Git commit 44d77cd16c2547c614f745ee233ddbdd4ab989be by Frank Reininghaus.
Committed on 03/06/2012 at 23:03.
Pushed by freininghaus into branch 'master'.

Ctrl+Shift+click should have the same effect as Shift+click

This makes Dolphin 2.0's behaviour consistent with Dolphin 1.x.
FIXED-IN: 4.9.0

M  +1    -1    dolphin/src/kitemviews/kitemlistcontroller.cpp

http://commits.kde.org/kde-baseapps/44d77cd16c2547c614f745ee233ddbdd4ab989be