┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinviewactionhandler.cpp
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2017-03-10 19:31:33 +0100
committerElvis Angelaccio <[email protected]>2017-03-13 19:40:07 +0100
commit68bb0ec22af0290d298a87a15006f888b0aaf3b9 (patch)
tree39ac14dadede61bc47b1024a962e2db790ca7a3a /src/views/dolphinviewactionhandler.cpp
parent042b0c84099c062847fa2ed46a145624a96f90ca (diff)
Port to KStandardAction::DeleteFile
Summary: It was introduced in kconfig 5.25 and it properly handles the shift+del shortcut (together with kxmlgui >= 5.30). This allows us to drop the custom delete shortcut as well as the shift+del workaround in DolphinMainWindow. Test Plan: Shift+Del still deletes files, without the 'ambiguous shortcut' warning dialog. Reviewers: emmanuelp Differential Revision: https://phabricator.kde.org/D5010
Diffstat (limited to 'src/views/dolphinviewactionhandler.cpp')
-rw-r--r--src/views/dolphinviewactionhandler.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp
index 273bcdd76..7e52d5b28 100644
--- a/src/views/dolphinviewactionhandler.cpp
+++ b/src/views/dolphinviewactionhandler.cpp
@@ -120,14 +120,10 @@ void DolphinViewActionHandler::createActions()
connect(moveToTrash, &QAction::triggered,
this, &DolphinViewActionHandler::slotTrashActivated);
- QAction* deleteAction = m_actionCollection->addAction(QStringLiteral("delete"));
- deleteAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-delete")));
- deleteAction->setText(i18nc("@action:inmenu File", "Delete"));
- m_actionCollection->setDefaultShortcut(deleteAction, Qt::SHIFT | Qt::Key_Delete);
- connect(deleteAction, &QAction::triggered, this, &DolphinViewActionHandler::slotDeleteItems);
+ KStandardAction::deleteFile(this, &DolphinViewActionHandler::slotDeleteItems, m_actionCollection);
// 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
+ // disabled and KStandardAction::DeleteFile 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.
QAction* deleteWithTrashShortcut = m_actionCollection->addAction(QStringLiteral("delete_shortcut"));