diff options
| author | Elvis Angelaccio <[email protected]> | 2017-08-09 22:59:38 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2017-08-09 22:59:38 +0200 |
| commit | 5481709016a55bda94177217838318e4e3e7d370 (patch) | |
| tree | 1d16d19373929ac36042c21dfd38e567a8404c87 /src/views | |
| parent | f38960e034cf622bc87575e91014404e8128f120 (diff) | |
Port to KStandardAction::RenameFile
It was introduced in kconfig(widgets) 5.25. Using the standard action
results in less code and no need to hardcode the F2 shortcut.
Differential Revision: https://phabricator.kde.org/D6777
Diffstat (limited to 'src/views')
| -rw-r--r-- | src/views/dolphinviewactionhandler.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index 5f98577b1..538fd8a51 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -107,11 +107,7 @@ void DolphinViewActionHandler::createActions() // File menu - QAction* rename = m_actionCollection->addAction(QStringLiteral("rename")); - rename->setText(i18nc("@action:inmenu File", "Rename...")); - m_actionCollection->setDefaultShortcut(rename, Qt::Key_F2); - rename->setIcon(QIcon::fromTheme(QStringLiteral("edit-rename"))); - connect(rename, &QAction::triggered, this, &DolphinViewActionHandler::slotRename); + KStandardAction::renameFile(this, &DolphinViewActionHandler::slotRename, m_actionCollection); KStandardAction::moveToTrash(this, &DolphinViewActionHandler::slotTrashActivated, m_actionCollection); KStandardAction::deleteFile(this, &DolphinViewActionHandler::slotDeleteItems, m_actionCollection); |
