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 585790 - Nautilus doesn't support XDS DND "F" fallback
Nautilus doesn't support XDS DND "F" fallback
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
2.26.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-14 23:07 UTC by James Dietrich
Modified: 2009-11-17 12:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch implementing XDS "F" fallback for nautilus (25.09 KB, patch)
2009-06-14 23:08 UTC, James Dietrich
needs-work Details | Review
Test program for "F" fallback of XDS (3.88 KB, text/x-python)
2009-06-14 23:10 UTC, James Dietrich
  Details
Updated patch implementing XDS "F" fallback for nautilus (24.67 KB, patch)
2009-10-28 00:03 UTC, James Dietrich
committed Details | Review

Description James Dietrich 2009-06-14 23:07:41 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
Comment 1 James Dietrich 2009-06-14 23:08:49 UTC
Created attachment 136588 [details] [review]
Patch implementing XDS "F" fallback for nautilus
Comment 2 James Dietrich 2009-06-14 23:10:37 UTC
Created attachment 136589 [details]
Test program for "F" fallback of XDS
Comment 3 xavier.bestel 2009-06-15 08:50:59 UTC
This looks like a duplicate of bug#171655
Comment 4 James Dietrich 2009-06-15 10:00:18 UTC
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.
Comment 5 A. Walton 2009-06-16 09:19:30 UTC
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.
Comment 6 James Dietrich 2009-10-28 00:01:07 UTC
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.
Comment 7 James Dietrich 2009-10-28 00:03:53 UTC
Created attachment 146390 [details] [review]
Updated patch implementing XDS "F" fallback for nautilus