X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/de3e2ae40f626c1368dfd40bace54ef3e7815833..c96efc7ccba67a48920713a2d2b0461c747ca3fb:/src/dolphinremoveaction.cpp diff --git a/src/dolphinremoveaction.cpp b/src/dolphinremoveaction.cpp index 1ce292604..79d6bed60 100644 --- a/src/dolphinremoveaction.cpp +++ b/src/dolphinremoveaction.cpp @@ -45,17 +45,22 @@ void DolphinRemoveAction::update() // Using setText(action->text()) does not apply the &-shortcut. // This is only done until the original action has been shown at least once. To // bypass this issue, the text and &-shortcut is applied manually. - if (qApp->keyboardModifiers() & Qt::ShiftModifier) { - m_action = m_collection ? m_collection->action("delete") : 0; + if (qApp->queryKeyboardModifiers() & Qt::ShiftModifier) { + m_action = m_collection ? m_collection->action(KStandardAction::name(KStandardAction::DeleteFile)) : 0; setText(i18nc("@action:inmenu", "&Delete")); + // Make sure we show Shift+Del in the context menu. + auto deleteShortcuts = m_action->shortcuts(); + deleteShortcuts.removeAll(Qt::SHIFT | Qt::Key_Delete); + deleteShortcuts.prepend(Qt::SHIFT | Qt::Key_Delete); + m_collection->setDefaultShortcuts(this, deleteShortcuts); } else { - m_action = m_collection ? m_collection->action("move_to_trash") : 0; + m_action = m_collection ? m_collection->action(QStringLiteral("move_to_trash")) : 0; setText(i18nc("@action:inmenu", "&Move to Trash")); + m_collection->setDefaultShortcuts(this, m_action->shortcuts()); } if (m_action) { setIcon(m_action->icon()); - setShortcuts(m_action->shortcuts()); setEnabled(m_action->isEnabled()); } }