From 5481709016a55bda94177217838318e4e3e7d370 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Wed, 9 Aug 2017 22:59:38 +0200 Subject: 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 --- src/views/dolphinviewactionhandler.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/views/dolphinviewactionhandler.cpp') 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); -- cgit v1.3