┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorYann Holme-Nielsen <[email protected]>2020-06-29 22:27:33 +0000
committerElvis Angelaccio <[email protected]>2020-06-29 22:27:33 +0000
commit86e3b82efbbcdb287773cdaf6a5f4c1c22bb9fc6 (patch)
tree7ce105d0ca28e4de8e019bc3dd36a050a5c05013 /src/dolphinmainwindow.cpp
parentd1baf3398e53931735b724672d5ae48649b44a18 (diff)
## Summary
* Adds a "Copy location" item, after the "Copy" Context item and Edit Menu, which will attempt to copy the path of the fist item into clipboard. ## Reasoning Most File Managers have this option through one or another way. Also using the default Copy option often results in different behaviour depending on the target software, Konsole will take the path. Other Programs will use the URI. Which ultimately could lead to non optimal User Experience. ## Notes * Should the target file **not** be on a local hard drive, this fallback to using the remote URL, feedback is wanted on that matter. FEATURE: 407004
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index d45b77676..5741e8943 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -1129,6 +1129,7 @@ void DolphinMainWindow::updateControlMenu()
// Add "Edit" actions
bool added = addActionToMenu(ac->action(KStandardAction::name(KStandardAction::Undo)), menu) |
+ addActionToMenu(ac->action(QString("copy_location")), menu) |
addActionToMenu(ac->action(QStringLiteral("copy_to_inactive_split_view")), menu) |
addActionToMenu(ac->action(QStringLiteral("move_to_inactive_split_view")), menu) |
addActionToMenu(ac->action(KStandardAction::name(KStandardAction::SelectAll)), menu) |
@@ -1911,6 +1912,7 @@ void DolphinMainWindow::updateFileAndEditActions()
QAction* addToPlacesAction = col->action(QStringLiteral("add_to_places"));
QAction* copyToOtherViewAction = col->action(QStringLiteral("copy_to_inactive_split_view"));
QAction* moveToOtherViewAction = col->action(QStringLiteral("move_to_inactive_split_view"));
+ QAction* copyLocation = col->action(QString("copy_location"));
if (list.isEmpty()) {
stateChanged(QStringLiteral("has_no_selection"));
@@ -1918,6 +1920,7 @@ void DolphinMainWindow::updateFileAndEditActions()
addToPlacesAction->setEnabled(true);
copyToOtherViewAction->setEnabled(false);
moveToOtherViewAction->setEnabled(false);
+ copyLocation->setEnabled(false);
} else {
stateChanged(QStringLiteral("has_selection"));
@@ -1959,6 +1962,7 @@ void DolphinMainWindow::updateFileAndEditActions()
deleteAction->setEnabled(capabilitiesSource.supportsDeleting());
deleteWithTrashShortcut->setEnabled(capabilitiesSource.supportsDeleting() && !enableMoveToTrash);
cutAction->setEnabled(capabilitiesSource.supportsMoving());
+ copyLocation->setEnabled(list.length() == 1);
showTarget->setEnabled(list.length() == 1 && list.at(0).isLink());
duplicateAction->setEnabled(capabilitiesSource.supportsWriting());
}