After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 386800 - No 'Paste into folder' option in the menu of a mounted device
No 'Paste into folder' option in the menu of a mounted device
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Cut Copy Paste Undo
2.16.x
Other Linux
: Normal minor
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-12-17 14:39 UTC by Sebastien Bacher
Modified: 2008-01-28 11:12 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Add "Paste Into Folder" to the context menus of mounted volumes and disks (2.66 KB, patch)
2008-01-06 07:11 UTC, John Millikin
needs-work Details | Review
Add "Paste Into Folder" to context menus (for GIO) (1.84 KB, patch)
2008-01-06 22:21 UTC, John Millikin
needs-work Details | Review
Add "Paste Into Folder" to context menus (for GIO, v2) (2.75 KB, patch)
2008-01-13 20:27 UTC, John Millikin
none Details | Review

Description Sebastien Bacher 2006-12-17 14:39:01 UTC
That bug has been opened on https://launchpad.net/distros/ubuntu/+source/nautilus/+bug/63614

"Binary package hint: nautilus

After copying a file in Nautilus, it is possible to paste it into a folder via right-clicking on the folder and selecting 'Paste Into Folder'. However, this option does not exist when right-clicking on mounted devices (such as a USB drive or network share)."
Comment 1 John Millikin 2008-01-06 07:11:16 UTC
Created attachment 102260 [details] [review]
Add "Paste Into Folder" to the context menus of mounted volumes and disks
Comment 2 John Millikin 2008-01-06 08:29:47 UTC
Forgot to mention, that patch applies to the 2.20 tree, not the new GIO stuff.
Comment 3 John Millikin 2008-01-06 22:21:58 UTC
Created attachment 102292 [details] [review]
Add "Paste Into Folder" to context menus (for GIO)

GIO version
Comment 4 Alexander Larsson 2008-01-10 13:29:11 UTC
can_unmount is not the right check. There are mounts that you aren't allowed to unmount that you can write to.

Should check for (writable && is_directory) || type == MOUNTABLE || type == SHORTCUT.

Of course, the later two should only really be allowed if they point to a directory, and that directory is writable. But we can ignore that for now and just display an error dialog if that is not true.
Comment 5 John Millikin 2008-01-13 20:27:17 UTC
Created attachment 102761 [details] [review]
Add "Paste Into Folder" to context menus (for GIO, v2)

New patch, this tests if the file has an activation URI. If so, it tests for the ability to paste into that URI.

For some reason, when I construct a NautilusFile using nautilus_file_get_by_uri, is_directory always returns FALSE. I had to manually retrieve a GFileInfo and run tests against that.
Comment 6 Alexander Larsson 2008-01-28 11:12:41 UTC
The reason that is_directory() returns FALSE for you is that the data for the NautilusFile has not been read yet. One needs to request that info and await its async reading by either a call_when_ready() or a monitor() call. 

Sync I/O like that is not allowed in nautilus.

I've commited a patch based on your code that handles this by looking at the activation location and returning true if is_directory and can_write, or if the target type is unknown. In practice i think most links like that will be to directories, so its probably ok.

Its kinda a pain to handle the async I/O stuff correctly with DnD...