diff options
| author | Elvis Angelaccio <[email protected]> | 2017-07-19 00:00:37 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2017-07-27 16:15:03 +0200 |
| commit | 4b5ea05b6760e9020ab87f1d90071e1a2a8f9e99 (patch) | |
| tree | d1c87653f2ebaecdf0cb5b110b24a7242f4cc3d6 /src/views | |
| parent | 82b2dbd3ec568a6e6fe01a8e75739b25cae25f15 (diff) | |
Port to KStandardAction::MoveToTrash
It was introduced in kconfig(widgets) 5.25. Using the standard action
results in less code and no need to hardcode the Del shortcut.
Test Plan:
- Change shortcut in System Settings -> Shortcuts -> Standard Shortcuts
- Make sure the new shortcut is used by dolphin.
Differential Revision: https://phabricator.kde.org/D6778
Diffstat (limited to 'src/views')
| -rw-r--r-- | src/views/dolphinviewactionhandler.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index 7e52d5b28..5f98577b1 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -113,16 +113,10 @@ void DolphinViewActionHandler::createActions() rename->setIcon(QIcon::fromTheme(QStringLiteral("edit-rename"))); connect(rename, &QAction::triggered, this, &DolphinViewActionHandler::slotRename); - QAction* moveToTrash = m_actionCollection->addAction(QStringLiteral("move_to_trash")); - moveToTrash->setText(i18nc("@action:inmenu File", "Move to Trash")); - moveToTrash->setIcon(QIcon::fromTheme(QStringLiteral("user-trash"))); - m_actionCollection->setDefaultShortcut(moveToTrash, QKeySequence::Delete); - connect(moveToTrash, &QAction::triggered, - this, &DolphinViewActionHandler::slotTrashActivated); - + KStandardAction::moveToTrash(this, &DolphinViewActionHandler::slotTrashActivated, m_actionCollection); KStandardAction::deleteFile(this, &DolphinViewActionHandler::slotDeleteItems, m_actionCollection); - // This action is useful for being enabled when "move_to_trash" should be + // This action is useful for being enabled when KStandardAction::MoveToTrash should be // 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. |
