Bug 307254 - Right click menu 'move to trash' action shown when shift is held and 'delete' action is included
Summary: Right click menu 'move to trash' action shown when shift is held and 'delete'...
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 2.1
Platform: Ubuntu Linux
: NOR minor (vote)
Target Milestone: ---
Assignee: Dolphin Bug Assignee
Keywords: reproducible
Depends on:
Reported: 2012-09-23 08:31 UTC by David
Modified: 2013-06-09 09:55 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.11.0


Note You need to log in before you can comment on or make changes to this bug.
Description David 2012-09-23 08:31:15 UTC
Holding shift while the right-click menu is displayed turns the 'Move to Trash' action into a 'Delete' action.  This is all working correctly, and it is a feature that I really appreciate.

The issue only happens when the 'Delete' action is added to the context menu through the configuration options (Settings->Configure Dolphin...->Services then check 'Delete').  Then, the 'Move to Trash' option does not change visually in the right-click menu when shift is held, but clicking 'Move to Trash' while shift is held deletes the file rather than moving it to the trash.

As a solution, I see two options:
1. Even when the delete action is in the right click menu, change the 'Move to Trash' item to a 'Delete' item when shift is held.  This would result in two 'Delete' actions being shown if shift is held.
2. When there is already a 'Delete' item in the right-click menu, simply remove the 'Move to Trash' item when shift is held.

Reproducible: Always

Steps to Reproduce:
1.  Add the 'Delete' item to the right click menu (Settings->Configure Dolphin...->Services then check 'Delete')

2. Right click on a file (or select several files and then right click)

3. Hold shift button down
Actual Results:  
The 'Move to Trash' icon does not change visually, but the behavior changes so that clicking on the 'Move to Trash' icon deletes the item instead of moving it to the trash.

Expected Results:  
Either the 'Move to Trash' item should change to a 'Delete' item when shift is held, or the 'Move to Trash' item should be removed when shift is held.

Note that without the 'Delete' item added to the menu through the configuration, the 'Move to Trash' item correctly changes into a 'Delete' item when shift is held.

I'm using KDE 4.9.1 in pre-release Kubuntu 12.10 (quantal) on an ASUS Eee 1215b.
Comment 1 Frank Reininghaus 2012-11-29 07:52:34 UTC
Thanks for the bug report, I can confirm the problem. DolphinContextMenu does not update the text if both actions are shown (which is good), but unfortunately, also DolphinViewActionHandler::slotTrashActivated() tries to be clever and deletes the item(s) if shift is pressed.
Comment 2 Frank Reininghaus 2012-11-29 08:07:03 UTC
Suggested fix at https://git.reviewboard.kde.org/r/107509/.
Comment 3 Frank Reininghaus 2013-06-09 09:55:55 UTC
Git commit fda03a10e725ba133a32a032f7f456d839e0d800 by Frank Reininghaus.
Committed on 09/06/2013 at 11:53.
Pushed by freininghaus into branch 'master'.

Do not delete files when Shift-clicking "Trash"

Thanks to Dawit Alemayehu for making this fix possible with commit
8e023ae9e5051cb7b81af86a178e37c1f2c5da94 !
FIXED-IN: 4.11.0

M  +1    -8    dolphin/src/views/dolphinviewactionhandler.cpp