I use Gentoo as my Web browser. I save a Microsoft Word document to my hard drive, and browse to it with Nautilus. I double click it, and it comes up in OpenOffice, like I want it to. Back in Galeon, I try to open the document from the Web, instead of saving to disk and opening from there. It doesn't return an error message but nothing gets launched. I did some straces and I found the problem. I can go to ~/.local/share/applications, and edit the file oowriter.desktop that I find there. I find the line: Exec='/usr/bin/oowriter' and remove the single quotes to yield: Exec=/usr/bin/oowriter I try to open the Word doc from Galeon again and now it comes up fine. So Nautilus is OK with those single quotes but Galeon is not. Either Galeon needs to be taught to ignore those single quotes like Nautilus does, or whatever is generating them needs to be changed to stop, so that Galeon (and maybe other programs) won't slip up.
After reading the specs for desktop entry files, it seems that they must not contain any quotes, so the .desktop-file is wrong. Reassigning to openoffice-maintainers.
Tried this experiment: I found a random PostScript file lying around in my home directory. In Nautilus, right-clicked, picked "Open With Other Application...". Browsed to /usr/bin/gnome-text-editor. Upon returning to the "Open With" dialog box, the path in the text box was '/usr/bin/gnome-text-editor', with single quotes. Hit OK and it launched. Then looked and found a gnome-text-editor.desktop file with the verboten single quotes. Deleted that file, redid the experiment, but deleted the single quotes that were added in the text box for me. The gnome-text-editor.desktop file omitted the single quotes. If I don't use "Browse" at all but type something in myself, whatever I type is placed verbatim after the Exec=. So Nautilus, or something, is adding single quotes by default to that text box when it shouldn't be. I deleted my oowriter.desktop file and tried to view that Word doc on the Web. Galeon doesn't give the option to "Open With", only to save to disk. I saved to disk and used the procedure listed above, as that appears to be the only way to associate that file type with OpenOffice.org (for a single user at least). So this is in fact a GNOME bug after all.
Created attachment 52334 [details] Screenshot of "Open With" dialog, with single quotes added by "Browse" dialog An incriminating screenshot, if you're interested.
I tried a similar experiment with a .pdf file. I "Opened with other application", then browsed to /usr/bin/gpdf, and the dialog returned the string with single quotes, which were written to my local .desktop file. But the file opened fine, both with and without quotes. I also tested it with gnome-text-editor as you did, which started fine, although of course it couldn't read the .pdf. In both cases they contained quotes, which I hanno says goes against the spec, but it works for me.
It also works for me--from Nautilus. Galeon, however, chokes on the quotes, which is what triggered this whole thing. In the name of being conservative in what you produce and liberal in what you accept, it makes sense to let Nautilus continue to accept single quotes where the spec says they shouldn't be. That is, unless the GNOME team has one or more BOFH members, in which case I say go ahead and make Nautilus start rejecting entries with single quotes, and let thousands of Gentoo desktops suddenly break upon their next emerge -Du world ;). However, Nautilus definitely shouldn't be producing them, since they're out of spec and especially since other apps are breaking as a result. A related question is whether to patch Galeon to ignore the quotes for systems that have bad *.desktop files already. I say "no", on the grounds that it's not a Good Thing(TM) to do anything to encourage breakage to persist further, and it's trivial (by my definition) to fix the breakage itself (in the *.desktop files and/or the Nautilus code that creates them).
This is all based on the assumption that quotes are not allowed. I can't find a statement on quotes in the specs, where did you get that from hanno ?
As you said, there is no statement about quotes in the spec. From the spec: Entries in the file are {key,value} pairs in the format: Key=Value Space before and after the equals sign should be ignored; the = sign is the actual delimiter. So it says spaces after the equals sign are ok, but it says nothing about quotes, so I assume everything after the = is the string of the value. As long as it says nothing about quotes, I assume quotes aren't allowed. I think we should contact the spec-authors to make clear whether quotes are allowed or not. I'll write them a mail. The desktop-entry-spec is at http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-0.9.4.html
Any news on this hanno?
reporter: can you still reproduce this in the now stable version of galeon?
Using GNOME 2.10.2 and Galeon 1.3.21, this doesn't seem to be a problem. Nautilus now generates files with *double* quotes, not single quotes. I edited the file that Nautilus generated to use single quotes, and both Nautilus and Galeon handled it fine (though I didn't restart Nautilus before testing). I'll note that the dialog box to type or confirm the filename for the launched executable doesn't exist any more, so the "incriminating screenshot" I posted earlier can't happen. I'll also note that in order to test this, I had to remove the writer.desktop file in /usr/share/applications/, which evidently has been added since I posted this bug. (That file, BTW, uses double quotes.) This looks fixed to me.