+ QAction *copyPathAction = m_actionCollection->addAction(QStringLiteral("copy_location"));
+ copyPathAction->setText(i18nc("@action:incontextmenu", "Copy Location"));
+ copyPathAction->setWhatsThis(i18nc("@info:whatsthis copy_location", "This will copy the path of the first selected item into the clipboard."));
+
+ copyPathAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy-path")));
+ m_actionCollection->setDefaultShortcuts(copyPathAction, {Qt::CTRL | Qt::ALT | Qt::Key_C});
+ connect(copyPathAction, &QAction::triggered, this, &DolphinViewActionHandler::slotCopyPath);
+
+ if (actionTextHelper) {
+ // The "…" at the end make clear that they won't trigger their respective actions directly.
+ actionTextHelper->registerTextWhenNothingIsSelected(trashAction, i18nc("@action:inmenu File", "Move to Trash…"));
+ actionTextHelper->registerTextWhenNothingIsSelected(deleteAction, i18nc("@action:inmenu File", "Delete…"));
+ actionTextHelper->registerTextWhenNothingIsSelected(duplicateAction, i18nc("@action:inmenu File", "Duplicate Here…"));
+ actionTextHelper->registerTextWhenNothingIsSelected(copyPathAction, i18nc("@action:incontextmenu", "Copy Location…"));
+ }
+
+ // This menu makes sure that users who don't know how to open a context menu and haven't
+ // figured out how to enable the menu bar can still perform basic file manipulation.
+ // This only works if they know how to select a file.
+ // The text when nothing is selected at least implies that a selection can /somehow/ be made.
+ // This menu is by default only used in the hamburger menu but created here so users can put
+ // it on their toolbar.
+ KActionMenu *basicActionsMenu = m_actionCollection->add<KActionMenu>(QStringLiteral("basic_actions"), this);
+ // The text is set later depending on the selection in the currently active view.
+ basicActionsMenu->setPopupMode(QToolButton::InstantPopup);
+ basicActionsMenu->addAction(m_actionCollection->action(KStandardAction::name(KStandardAction::Cut)));
+ basicActionsMenu->addAction(m_actionCollection->action(KStandardAction::name(KStandardAction::Copy)));
+ basicActionsMenu->addAction(m_actionCollection->action(KStandardAction::name(KStandardAction::Paste)));
+ basicActionsMenu->addSeparator();
+ basicActionsMenu->addAction(m_actionCollection->action(KStandardAction::name(KStandardAction::RenameFile)));
+ basicActionsMenu->addAction(m_actionCollection->action(KStandardAction::name(KStandardAction::MoveToTrash)));
+ basicActionsMenu->addSeparator();
+ basicActionsMenu->addAction(m_actionCollection->action(QStringLiteral("properties")));
+ basicActionsMenu->addSeparator(); // We add one more separator because we sometimes add contextual
+ // actions in slotSelectionChanged() after the static ones above.
+