Bug 344156

Summary: Use digiKam with your keyboard, delete the wrong photos [patch]
Product: [Applications] digikam Reporter: DrSlony <bugs>
Component: Albums-TrashAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: bugs, caulier.gilles, metzpinguin
Priority: NOR    
Version: 4.7.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 4.8.0
Sentry Crash Report:
Attachments: selection.patch

Description DrSlony 2015-02-14 12:43:38 UTC
This was reported by others and by myself in some other issue long ago. I can't find the issue but it is still very valid.

You have a bunch of photos. Select one with the mouse, then use the keyboard from now on.
Delete a bunch of photos. The selectin box lands on some photo. You decide you want to delete this photo and the next one, so you hold shift and click the right arrow, then click delete. You'd think that would work, but no. What actually happens is that now a whole bunch of photos are selected which you had no intention of selecting, and if you're a fast computer user you may have hit [delete] before you realize digiKam's image selection is bugged and you're deleting your good shots.

In this video the selection box was on 17. Image 13 is to the left of it. I clicked shift+left and instead of having 17 and 13 selected, I ended up having 13-20 selected. 
Again the same story near the end of the video when focus was on 04. I clicked shift+right, and instead of selecting 04 and 05, it selected 01-07... If you're a fast keyboard ninja, you better also be a file recovery ninja.

Reproducible: Always
Comment 1 DrSlony 2015-02-14 12:44:33 UTC
Screencast: http://filebin.net/p2qyrq4f2k
Comment 2 Maik Qualmann 2015-02-21 11:37:20 UTC
Created attachment 91199 [details]
selection.patch

This patch is a workaround for this issue. I have debug a lot of code from digiKam and think it is a possibly issue in Qt 4.x. Will keep it in mind for the next versions.
Comment 3 caulier.gilles 2015-02-21 13:20:20 UTC
Git commit 79f622a664645c70f6a5b62a0ad29352d5dcf81b by Gilles Caulier.
Committed on 21/02/2015 at 13:17.
Pushed by cgilles into branch 'master'.

apply patch #91199 from MAik Qualmann to fix item selection from icon-view when keyboard is used to delete items.
FIXED-IN: 4.8.0

M  +2    -1    NEWS
M  +7    -0    libs/widgets/itemview/digikamkcategorizedview.cpp

http://commits.kde.org/digikam/79f622a664645c70f6a5b62a0ad29352d5dcf81b
Comment 4 caulier.gilles 2015-02-21 14:26:08 UTC
Git commit 76727ec50580ee0e466f4aeb3d94f3cef381b496 by Gilles Caulier.
Committed on 21/02/2015 at 14:23.
Pushed by cgilles into branch 'frameworks'.

backport commit #79f622a664645c70f6a5b62a0ad29352d5dcf81b from git/master to frameworks branch

M  +7    -0    libs/widgets/itemview/dcategorizedview.cpp

http://commits.kde.org/digikam/76727ec50580ee0e466f4aeb3d94f3cef381b496
Comment 5 Maik Qualmann 2015-12-01 19:27:23 UTC
Git commit ef564973a58e86ce1e83b8cd6922b3078a9c3030 by Maik Qualmann.
Committed on 01/12/2015 at 19:24.
Pushed by mqualmann into branch 'master'.

remove workaround for bug 344156, with Qt5 is no longer needed

M  +0    -7    libs/widgets/itemview/dcategorizedview.cpp

http://commits.kde.org/digikam/ef564973a58e86ce1e83b8cd6922b3078a9c3030