Bug 436362 - Pressing Shift + Del, in addition to permanently deleting, also cuts the selected items to the clipboard
Summary: Pressing Shift + Del, in addition to permanently deleting, also cuts the sele...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Desktop icons & Folder View widget (show other bugs)
Version: 5.21.4
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: usability
: 460302 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-04-29 14:54 UTC by popov895
Modified: 2023-04-27 16:47 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.5
Sentry Crash Report:


Attachments
Two actions with the same shortcut in Shortcuts KCM (158.32 KB, image/jpeg)
2021-04-30 20:20 UTC, popov895
Details

Note You need to log in before you can comment on or make changes to this bug.
Description popov895 2021-04-29 14:54:29 UTC
SUMMARY

Pressing Shift + Del in the Folder View performs a double action: in addition to permanently deleting, it also cuts the selected items to the clipboard.

STEPS TO REPRODUCE

1. Select some item(s);
2. Press Shift+Del.

OBSERVED RESULT

Selected items are permanently deleted and cut to the clipboard at the same time.

EXPECTED RESULT

Selected items are permanently deleted.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: KDE neon 5.21 User Edition / X11
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.81.0
KDE Gear: 21.04.0
Qt Version: 5.15.2
Comment 1 Nate Graham 2021-04-30 16:29:17 UTC
Can confirm.
Comment 2 Nate Graham 2021-04-30 19:27:57 UTC
It appears that this is sort a Qt bug... or at least an incompatibility between us and Qt. You see, Qt assigns Shift+Del to "Cut" on KDE Plasma, Gnome, and Windows platforms. See https://doc.qt.io/qt-5/qkeysequence.html#standard-shortcuts

We consume these definitions in plasma-integration: https://invent.kde.org/plasma/plasma-integration/-/blob/master/src/platformtheme/kdeplatformtheme.cpp#L195

And Folder view then makes those shortcuts available to the user... where they conflict with our own action for Shift+Delete.

Not sure how to proceed.
Comment 3 popov895 2021-04-30 20:20:35 UTC
Created attachment 138038 [details]
Two actions with the same shortcut in Shortcuts KCM

Personally, I'd like the behavior to be the same as in the Dolphin - permanently deletion.
Comment 4 David Edmundson 2021-04-30 23:12:43 UTC
Relevant link in other apps so we can see what they did:
https://bugs.kde.org/show_bug.cgi?id=347373

The solution there looks very route-1, just un-assigning whatever is set as the shortcut for cut. 

Something I would have almost certainly not accepted, but now you can claim prior art and I won't have a choice.
Comment 5 Nate Graham 2021-05-03 21:26:22 UTC
Urgh.

What would you suggest as a more durable solution?
Comment 6 popov895 2021-11-09 08:43:54 UTC
How about adding a keyboard shortcuts settings page to the Folder View applet?
Comment 7 popov895 2023-04-19 16:38:36 UTC
Git commit 2c6f537026ac2b4a150b4bb44066f59f8791e30f by Eugene Popov.
Committed on 19/04/2023 at 15:10.
Pushed by ngraham into branch 'master'.

Folder View: fix keyboard shortcuts handling

Avoid handling the keyboard shortcut multiple times.

M  +8    -5    containments/desktop/package/contents/ui/FolderView.qml
M  +10   -3    containments/desktop/plugins/folder/shortcut.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/2c6f537026ac2b4a150b4bb44066f59f8791e30f
Comment 8 Nate Graham 2023-04-19 16:40:57 UTC
Git commit 1cceee9a9ef59696e067a4129cc702e31f51bcd1 by Nate Graham, on behalf of Eugene Popov.
Committed on 19/04/2023 at 16:40.
Pushed by ngraham into branch 'Plasma/5.27'.

Folder View: fix keyboard shortcuts handling

Avoid handling the keyboard shortcut multiple times.


(cherry picked from commit 2c6f537026ac2b4a150b4bb44066f59f8791e30f)

M  +8    -5    containments/desktop/package/contents/ui/FolderView.qml
M  +10   -3    containments/desktop/plugins/folder/shortcut.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/1cceee9a9ef59696e067a4129cc702e31f51bcd1
Comment 9 Nate Graham 2023-04-27 16:47:16 UTC
*** Bug 460302 has been marked as a duplicate of this bug. ***