mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
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
This commit is contained in:
parent
c58226ce4f
commit
f20300256b
|
@ -61,10 +61,15 @@ void DolphinRemoveAction::update(ShiftState shiftState)
|
||||||
m_collection->setDefaultShortcuts(this, deleteShortcuts);
|
m_collection->setDefaultShortcuts(this, deleteShortcuts);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ShiftState::Released:
|
case ShiftState::Released: {
|
||||||
m_action = m_collection->action(KStandardAction::name(KStandardAction::MoveToTrash));
|
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;
|
break;
|
||||||
|
}
|
||||||
case ShiftState::Unknown:
|
case ShiftState::Unknown:
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -109,7 +109,13 @@ void DolphinViewActionHandler::createActions()
|
||||||
|
|
||||||
KStandardAction::renameFile(this, &DolphinViewActionHandler::slotRename, m_actionCollection);
|
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 deleteAction = KStandardAction::deleteFile(this, &DolphinViewActionHandler::slotDeleteItems, m_actionCollection);
|
||||||
auto deleteShortcuts = deleteAction->shortcuts();
|
auto deleteShortcuts = deleteAction->shortcuts();
|
||||||
if (!deleteShortcuts.contains(Qt::SHIFT | Qt::Key_Delete)) {
|
if (!deleteShortcuts.contains(Qt::SHIFT | Qt::Key_Delete)) {
|
||||||
|
|
Loading…
Reference in a new issue