┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinviewactionhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/dolphinviewactionhandler.cpp')
-rw-r--r--src/views/dolphinviewactionhandler.cpp17
1 files changed, 16 insertions, 1 deletions
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 <KNewFileMenu>
#include <KPropertiesDialog>
#include <KProtocolManager>
-
#include <QMenu>
#include <QPointer>
@@ -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();
+}