From 68bb0ec22af0290d298a87a15006f888b0aaf3b9 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Fri, 10 Mar 2017 19:31:33 +0100 Subject: 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 --- src/views/dolphinviewactionhandler.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/views/dolphinviewactionhandler.cpp') 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")); -- cgit v1.3