Bug 317877 - Allow copying a files full path via context menu
Summary: Allow copying a files full path via context menu
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.12.2
Platform: Other Other
: NOR wishlist
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
: 172206 328514 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-05 12:22 UTC by Dan MacDonald
Modified: 2013-12-07 16:41 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan MacDonald 2013-04-05 12:22:32 UTC
For various reasons and uses, I would like to be able to quickly and easily copy the full path of a selected file from its Dolphin context menu. In most cases I would want spaces etc in the path to be escaped so that I can paste the path into a terminal command or script and expect it to work but it could be useful to have the option to also copy the file path 'as is'.

I'd prefer it be added as a new item in the Dolphin file context menu but if thats not an option then maybe it could live under Properties?

Thanks!

Reproducible: Always
Comment 1 Frank Reininghaus 2013-04-05 12:25:37 UTC
Thanks for the report, but I think that there is no need to implement something like that in Dolphin itself. If I'm not mistaken, this could be solved easily by a context menu plugin. Have you checked if such a thing exists already?
Comment 2 Dan MacDonald 2013-04-05 12:35:16 UTC
Hi Frank!

Thanks for the quick response!

Yes, I've had a look on KDE apps and asked in #kde and as far as I can tell no-one has created such a Dolphin plugin yet.

Have you got any tips on how I could write it? ie how would I get a string copied into KDE's clipboard from a script/service?
Comment 3 Frank Reininghaus 2013-04-08 11:53:12 UTC
In a C++/Qt program, you can interact with the clipboard via QClipboard:

http://qt-project.org/doc/qt-4.8/qclipboard.html#setText

I guess this is also possible in other programming languages which have Qt bindings. Most likely, there also exist ways to do it without depending on Qt.
Comment 4 Dan MacDonald 2013-04-11 07:27:29 UTC
Hi Frank!

I wrote a service menu for this last night which I've uploaded for everyone here:

http://kde-look.org/content/show.php?content=158153

That does what I need with no C++/Qt required! :)
Comment 5 Frank Reininghaus 2013-04-11 07:42:53 UTC
Just tried it - nice work, and with no code at all :-) Sometimes it's really better to check what possibilities the existing tools like kdialog offer before trying to invent something new.

Two remarks (feel free to ignore them):

1. I would leave out the ' before and after the path. I guess that people will usually want to copy just the path, nothing else.

2. Concerning the name: note that the string shown for other context menu plugins describes the action that they perform. Maybe "Copy file path..." or something like that would be better?
Comment 6 Dan MacDonald 2013-04-11 08:17:41 UTC
Hi Frank!

The quotes are intentional. Its so its output will work without
modification for files with and without spaces (in their path) and its my
way of avoiding adding some 'need for quotes' detection code. :)

As for the name, maybe I'll change that if people use it and I make another
release. The only other thing I'd consider adding is an option to just copy
the file name and not path+file and the 'need for quotes detector'.


On Thu, Apr 11, 2013 at 8:42 AM, Frank Reininghaus <frank78ac@googlemail.com
> wrote:

> https://bugs.kde.org/show_bug.cgi?id=317877
>
> --- Comment #5 from Frank Reininghaus <frank78ac@googlemail.com> ---
> Just tried it - nice work, and with no code at all :-) Sometimes it's
> really
> better to check what possibilities the existing tools like kdialog offer
> before
> trying to invent something new.
>
> Two remarks (feel free to ignore them):
>
> 1. I would leave out the ' before and after the path. I guess that people
> will
> usually want to copy just the path, nothing else.
>
> 2. Concerning the name: note that the string shown for other context menu
> plugins describes the action that they perform. Maybe "Copy file path..."
> or
> something like that would be better?
>
> --
> You are receiving this mail because:
> You reported the bug.
>
Comment 7 Frank Reininghaus 2013-12-07 16:39:42 UTC
*** Bug 328514 has been marked as a duplicate of this bug. ***
Comment 8 Frank Reininghaus 2013-12-07 16:41:22 UTC
*** Bug 172206 has been marked as a duplicate of this bug. ***