GNOME Bugzilla – Bug 585790
Nautilus doesn't support XDS DND "F" fallback
Last modified: 2009-11-17 12:12:44 UTC
Background: This bugreport concerns nautilus' support for XDS. For more information about what XDS is and the standard for implementing it, see http://www.newplanetsoftware.com/xds/ Short version: Nautilus doesn't implement the "F" fallback in the XDS standard. Long version: Nautilus has support for XDS, but it is not complete. In particular, it does not support the "F" fallback. The XDS standard outlines two ways for the file to be saved: (1) The source application does all the work of saving the file, with the file manager only providing the full URI where the file should be saved. (2) If the source application can't or won't save the file, the file manager should request the raw data (type application/octet-stream) from the source and then save the file itself. Number (2) is important because the source application may be running on a remote machine and have no way to do the work of saving the file. However, nautilus only implements number (1). The end result is that nautilus does not accept XDS drops from an application that can't or won't do all the work of saving the file. Proposed solution: One of my projects needed to have a file manager that fully implements XDS. So I patched nautilus to make it fully implement the XDS standard. I will attach the patch to this report. I use Debian testing, so I am working with Debian's nautilus package, which is 2.26.2. Description of the patch: Here are the main features of the patch: When handling an XDS drop, if the source sends the "F" fallback, then nautilus immediately requests the raw data in application/octet-stream format. Of course, nautilus then needs to be able to handle drops of raw data, so the patch adds that support as well. And since the raw data likely contains embedded nul bytes, a GString is used to hold the data instead of a char *. Test program: I will attach a simple test program written in Python. Dragging the top button to nautilus should create a file named 'tar' in the drop location which should be identical to the file '/bin/tar'. This tests the full implementation of the XDS standard. Dragging the bottom button should create a file named 'dropped data' in the drop location which also should be identical to the file '/bin/tar'. This does *not* use XDS; it just tests nautilus' acceptance of raw data (type application/octet-stream). BTW, nothing special about /bin/tar; it's just a hard-coded example that I supposed everyone would have. Let me know if you have any questions, or if there's anything else I can do to help. Thanks, James Dietrich
Created attachment 136588 [details] [review] Patch implementing XDS "F" fallback for nautilus
Created attachment 136589 [details] Test program for "F" fallback of XDS
This looks like a duplicate of bug#171655
The bug mentioned in Comment #3 does have to do with implementing XDS in nautilus. But it is only about adding XDS support to the list view. And furthermore, it does not address the subject of this bug, which is implementing the "F" fallback. In fact, attachment 118657 [details] [review] from bug #171655 (which was the patch that was committed a few months ago) contains this comment: /* Indicate that we don't provide "F" fallback */ That same comment is also in the nautilus 2.26.2 source for the icon view. The patch attached to this bug fills in this missing functionality and provides the "F" fallback outlined in the XDS specification--for both the icon view and the list view.
Alex's comments on the list (http://mail.gnome.org/archives/nautilus-list/2009-June/msg00018.html) suggest that the patch needs work, so I'm marking it as such so we can keep track.
I have finally taken the time to work on this again. I will attach a new patch that incorporates the following changes: -> Add a length argument to the functions that need it, rather than using a GString. -> Add missing spaces before parenthesis in function calls This patch applies cleanly to 2.28.1 and 2.29 Again, please let me know if there are any further questions.
Created attachment 146390 [details] [review] Updated patch implementing XDS "F" fallback for nautilus