X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/d1baf3398e53931735b724672d5ae48649b44a18..86e3b82efbbcdb287773cdaf6a5f4c1c22bb9fc6:/src/views/dolphinviewactionhandler.cpp diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index e89e2e62c..29bd530b4 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -34,7 +34,6 @@ #include #include #include - #include #include @@ -156,6 +155,17 @@ void DolphinViewActionHandler::createActions() m_actionCollection->setDefaultShortcuts(propertiesAction, {Qt::ALT + Qt::Key_Return, Qt::ALT + Qt::Key_Enter}); connect(propertiesAction, &QAction::triggered, this, &DolphinViewActionHandler::slotProperties); + 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"))); + m_actionCollection->setDefaultShortcuts(copyPathAction, {Qt::CTRL + Qt::SHIFT + Qt::Key_C}); + connect(copyPathAction, &QAction::triggered, this, &DolphinViewActionHandler::slotCopyPath); + + // View menu KToggleAction* iconsAction = iconsModeAction(); KToggleAction* compactAction = compactModeAction(); @@ -709,3 +719,8 @@ void DolphinViewActionHandler::slotProperties() dialog->raise(); dialog->activateWindow(); } + +void DolphinViewActionHandler::slotCopyPath() +{ + m_currentView->copyPathToClipboard(); +}