┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2017-10-16 19:56:31 +0200
committerElvis Angelaccio <[email protected]>2017-10-16 19:56:37 +0200
commitf20300256b19cb0a700bc6e5536ba9184503d918 (patch)
treea56d3fbd08d71743c73cd317de66ae38b9ffd684 /src/views
parentc58226ce4f40c5c475728587f5a735a75f8be901 (diff)
Make sure we always have the Del shortcut
Same fix as in D7655, but this time for the MoveToTrash standard action. Differential Revision: https://phabricator.kde.org/D7860
Diffstat (limited to 'src/views')
-rw-r--r--src/views/dolphinviewactionhandler.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp
index d0b9e7dc1..10aae11ce 100644
--- a/src/views/dolphinviewactionhandler.cpp
+++ b/src/views/dolphinviewactionhandler.cpp
@@ -109,7 +109,13 @@ void DolphinViewActionHandler::createActions()
KStandardAction::renameFile(this, &DolphinViewActionHandler::slotRename, m_actionCollection);
- KStandardAction::moveToTrash(this, &DolphinViewActionHandler::slotTrashActivated, m_actionCollection);
+ auto trashAction = KStandardAction::moveToTrash(this, &DolphinViewActionHandler::slotTrashActivated, m_actionCollection);
+ auto trashShortcuts = trashAction->shortcuts();
+ if (!trashShortcuts.contains(QKeySequence::Delete)) {
+ trashShortcuts.append(QKeySequence::Delete);
+ m_actionCollection->setDefaultShortcuts(trashAction, trashShortcuts);
+ }
+
auto deleteAction = KStandardAction::deleteFile(this, &DolphinViewActionHandler::slotDeleteItems, m_actionCollection);
auto deleteShortcuts = deleteAction->shortcuts();
if (!deleteShortcuts.contains(Qt::SHIFT | Qt::Key_Delete)) {