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/dolphinremoveaction.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/dolphinremoveaction.cpp') diff --git a/src/dolphinremoveaction.cpp b/src/dolphinremoveaction.cpp index ab1117770..ea7efe6c8 100644 --- a/src/dolphinremoveaction.cpp +++ b/src/dolphinremoveaction.cpp @@ -61,10 +61,15 @@ void DolphinRemoveAction::update(ShiftState shiftState) m_collection->setDefaultShortcuts(this, deleteShortcuts); break; } - case ShiftState::Released: + case ShiftState::Released: { m_action = m_collection->action(KStandardAction::name(KStandardAction::MoveToTrash)); - m_collection->setDefaultShortcuts(this, m_action->shortcuts()); + // Make sure we show Del in the context menu. + auto trashShortcuts = m_action->shortcuts(); + trashShortcuts.removeAll(QKeySequence::Delete); + trashShortcuts.prepend(QKeySequence::Delete); + m_collection->setDefaultShortcuts(this, trashShortcuts); break; + } case ShiftState::Unknown: Q_UNREACHABLE(); break; -- cgit v1.3