From f20300256b19cb0a700bc6e5536ba9184503d918 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Mon, 16 Oct 2017 19:56:31 +0200 Subject: 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 --- src/views/dolphinviewactionhandler.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/views/dolphinviewactionhandler.cpp') 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)) { -- cgit v1.3