Bug 270142

Summary: When using Ctrl to select multiple files the initial
Product: [Applications] krusader Reporter: Victor Varvaryuk <victor.varvariuc>
Component: generalAssignee: Jan Lepper <jan_lepper>
Status: RESOLVED FIXED    
Severity: normal CC: jan_lepper, klebezettel, legoduke
Priority: HI    
Version First Reported In: 2.2.0-beta1 "DeKaDe"   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: file selection with ctrl doesn't select current file

Description Victor Varvaryuk 2011-04-05 11:52:00 UTC
Created attachment 58594 [details]
file selection with ctrl doesn't select current file

Version:           2.2.0 (using KDE 4.6.1) 
OS:                Linux

When using Ctrl to select multiple files the initial file with cursor on it is not selected. In the attached file the cursor initially was on first file in the list - directory '.git', then i hold Ctrl and clicked last file - the folder '.git' remained unselected.

Reproducible: Always
Comment 1 Nikolai Kosjar 2012-03-29 19:11:43 UTC
That depends on your Selection Mode. Have a look at
Settings > Configure Krusader... > Panel > Selection Mode,
especially "Left mouse button selects". I think that's turned off on your side.
Comment 2 Victor Varvaryuk 2012-03-30 04:43:02 UTC
Yes, 'Left mouse button selects' is indeed turned off, but it should not influence this kind of selection. Even Dolphin works as it should - when a file has cursor on it and you press Ctrl and click on another file - both files are now selected. The same with Shift, which works as supposed in Krusader: you have cursor on a file, then press Shift and click on another file - all the files between the first and the second file, including them, are selected.

Here is a video, in which can notice another bug, which i also reported: though 'Left mouse button preserves selection' is not checked, i cannot reset the current selection clicking on any other unselected file, as Total Commander does.

http://youtu.be/xEZmN0WSPuo
Comment 3 Jan Lepper 2012-06-01 10:14:08 UTC
I assume the current behaviour is intended:  ctrl+mouseclick only toggles selection of the clicked item.
Comment 4 Victor Varvaryuk 2012-06-01 12:48:28 UTC
Is it intended or not - it is not what other file managers do. Even Dolphin does it the right (imo) way: if the cursor is on one file file and you left click on other file holding Ctrl, both file get selected.
Comment 5 mevsme 2015-03-23 13:17:44 UTC
Bug still exist in 4.13.3. And this is real bug. Why should I press CTRL to select only next, if I can just press RMB or space. So CTRL must select current and which pressed next.
When it will be fixed?
Comment 6 Martin Kostolný 2016-03-20 19:20:16 UTC
Git commit 8528c06ffe86231554189172b9cde02a8c38b6cb by Martin Kostolný.
Committed on 20/03/2016 at 19:12.
Pushed by martinkostolny into branch 'master'.

This patch modifies Krusader's item selection behaviour. It enables Krusader to select previously focused item when no other items are already selected.

For this to work (and to reuse existing code) I've modified KrView's method "getSelectedItems" to accept a bool flag to optionally return selected-only items (without the focused one).

REVIEW: 127439

M  +15   -2    krusader/Panel/krmousehandler.cpp
M  +1    -0    krusader/Panel/krmousehandler.h
M  +6    -4    krusader/Panel/krview.cpp
M  +1    -1    krusader/Panel/krview.h

http://commits.kde.org/krusader/8528c06ffe86231554189172b9cde02a8c38b6cb