┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinviewactionhandler.cpp
diff options
context:
space:
mode:
authorDavid Faure <[email protected]>2008-06-05 22:25:07 +0000
committerDavid Faure <[email protected]>2008-06-05 22:25:07 +0000
commit3d28c535643ce8ad0c91b20adbdd1229031d3c82 (patch)
tree5b4d3b175129147105da6e52a432de4da565d830 /src/dolphinviewactionhandler.cpp
parent008f524498475dd28717b1f3d65e2c99bbdb5b2a (diff)
When "move_to_trash" is disabled and "delete" is enabled (e.g. non-local files),
enable a hidden action with Key_Del as shortcut, so that the user can press Del to delete the file. BUG: 76016 svn path=/trunk/KDE/kdebase/apps/; revision=817389
Diffstat (limited to 'src/dolphinviewactionhandler.cpp')
-rw-r--r--src/dolphinviewactionhandler.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/dolphinviewactionhandler.cpp b/src/dolphinviewactionhandler.cpp
index 938ce785d..420db5404 100644
--- a/src/dolphinviewactionhandler.cpp
+++ b/src/dolphinviewactionhandler.cpp
@@ -93,6 +93,17 @@ void DolphinViewActionHandler::createActions()
deleteAction->setShortcut(Qt::SHIFT | Qt::Key_Delete);
connect(deleteAction, SIGNAL(triggered()), this, SLOT(slotDeleteItems()));
+ // This action is useful for being enabled when "move_to_trash" should be
+ // disabled and "delete" is enabled (e.g. non-local files), so that Key_Del
+ // can be used for deleting the file (#76016). It needs to be a separate action
+ // so that the Edit menu isn't affected.
+ KAction* deleteWithTrashShortcut = m_actionCollection->addAction("delete_shortcut");
+ // TODO after message freeze, a more descriptive text, for the shortcuts editor.
+ deleteWithTrashShortcut->setText(i18nc("@action:inmenu File", "Delete"));
+ deleteWithTrashShortcut->setShortcut(QKeySequence::Delete);
+ deleteWithTrashShortcut->setEnabled(false);
+ connect(deleteWithTrashShortcut, SIGNAL(triggered()), this, SLOT(slotDeleteItems()));
+
// View menu
QActionGroup* viewModeActions = new QActionGroup(this);