X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/68bb0ec22af0290d298a87a15006f888b0aaf3b9..3bfdf0d2:/src/views/dolphinviewactionhandler.cpp diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index 7e52d5b28..447d46f53 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -107,22 +107,12 @@ 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); - - 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::renameFile(this, &DolphinViewActionHandler::slotRename, m_actionCollection); + 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. @@ -154,11 +144,11 @@ void DolphinViewActionHandler::createActions() connect(viewModeActions, static_cast(&KSelectAction::triggered), this, &DolphinViewActionHandler::slotViewModeActionTriggered); KStandardAction::zoomIn(this, - SLOT(zoomIn()), + &DolphinViewActionHandler::zoomIn, m_actionCollection); KStandardAction::zoomOut(this, - SLOT(zoomOut()), + &DolphinViewActionHandler::zoomOut, m_actionCollection); KToggleAction* showPreview = m_actionCollection->add(QStringLiteral("show_preview"));