]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinviewactionhandler.cpp
Make sure we always have Shift+Del as shortcut
[dolphin.git] / src / views / dolphinviewactionhandler.cpp
index 7e52d5b284b76f90ae1ab8944e7f2895e45b3f4c..f4104d9cfeef21e166f989cc7d67457c67e00bae 100644 (file)
@@ -120,7 +120,12 @@ void DolphinViewActionHandler::createActions()
     connect(moveToTrash, &QAction::triggered,
             this, &DolphinViewActionHandler::slotTrashActivated);
 
-    KStandardAction::deleteFile(this, &DolphinViewActionHandler::slotDeleteItems, m_actionCollection);
+    auto deleteAction = KStandardAction::deleteFile(this, &DolphinViewActionHandler::slotDeleteItems, m_actionCollection);
+    auto deleteShortcuts = deleteAction->shortcuts();
+    if (!deleteShortcuts.contains(Qt::SHIFT | Qt::Key_Delete)) {
+        deleteShortcuts.append(Qt::SHIFT | Qt::Key_Delete);
+        m_actionCollection->setDefaultShortcuts(deleteAction, deleteShortcuts);
+    }
 
     // This action is useful for being enabled when "move_to_trash" should be
     // disabled and KStandardAction::DeleteFile is enabled (e.g. non-local files), so that Key_Del