GNOME Bugzilla – Bug 169198
wrong desktop file used
Last modified: 2005-03-05 12:02:31 UTC
Steps to reproduce: 0) Compile the attached testcase 1) rm -f ~/.local/share/applications/gedit.desktop 2) Associate text/plain files with gedit ("Text Editor") in nautilus 3) run the testcase with an existing file, like so: "./test test.c" 4) Right-click on any file in nautilus, choose "Open with other application" 5) Expand "Use custom command", enter "gedit --new-window" (without quotes) 6) do (3) again Expected results: Step 3 and 6 launch gedit, opening the file given as argument. Actual results: Step 6 launches gedit with a blank document. Further analysis reveals that in step 3, the desktop file associated with the default handler for text/plain is /usr/share/applications/gedit.desktop, while in step 6 it is ~/.local/share/applications/gedit.desktop, even though you didn't change the default handler! That desktop file has the Exec line "Exec=gedit --new-window"; note the absence of %U like in the system gedit.desktop file. GNOME-VFS 2.9.92, Nautilus 2.9.92 (ubuntu hoary).
Created attachment 38246 [details] testcase.c
Per IRC discussion I think this is not a bug. .local should have higher priority over system and the blank file problem is due to the fact that you are passing a path instead of an uri to gnome_vfs_application_launch. Feel free to reopen if you disagree.