]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinviewactionhandler.cpp
Two clicks on file/folder to rename
[dolphin.git] / src / views / dolphinviewactionhandler.cpp
index d0b9e7dc1ea6eb0e3505f87d1c5b87ee9195d7c1..10aae11ce6f30d6630cfe116614905184d3bc9f5 100644 (file)
@@ -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)) {