- QAction* rename = m_actionCollection->addAction("rename");
- rename->setText(i18nc("@action:inmenu File", "Rename..."));
- rename->setShortcut(Qt::Key_F2);
- rename->setIcon(QIcon::fromTheme("edit-rename"));
- connect(rename, &QAction::triggered, this, &DolphinViewActionHandler::slotRename);
-
- QAction* moveToTrash = m_actionCollection->addAction("move_to_trash");
- moveToTrash->setText(i18nc("@action:inmenu File", "Move to Trash"));
- moveToTrash->setIcon(QIcon::fromTheme("user-trash"));
- moveToTrash->setShortcut(QKeySequence::Delete);
- connect(moveToTrash, &QAction::triggered,
- this, &DolphinViewActionHandler::slotTrashActivated);
-
- QAction* deleteAction = m_actionCollection->addAction("delete");
- deleteAction->setIcon(QIcon::fromTheme("edit-delete"));
- deleteAction->setText(i18nc("@action:inmenu File", "Delete"));
- deleteAction->setShortcut(Qt::SHIFT | Qt::Key_Delete);
- connect(deleteAction, &QAction::triggered, this, &DolphinViewActionHandler::slotDeleteItems);
-
- // 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
+ 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 KStandardAction::MoveToTrash should be
+ // disabled and KStandardAction::DeleteFile is enabled (e.g. non-local files), so that Key_Del