GNOME Bugzilla – Bug 601287
should not require support for URIs from apps when openning files from the recent files list
Last modified: 2009-11-12 16:27:54 UTC
Created attachment 147295 [details] [review] proposed fix If you configure the association to open txt files, through nautilus, to make gvim the default, gnome-shell will still want to open the files using gedit. This is because it requires apps to support URIs. This should not be required, since glib is already handling these cases by giving local paths based on gvfs' fuse mounts. Patch by Guido Günther <agx@sigxcpu.org> with a small modification I discussed with him attached. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=553618 for the original report and patch.
Just to clarify, the patch drops the requirement for file:// paths only, but I suggest considering droping the requirement for all URI schemes.
Review of attachment 147295 [details] [review]: Good fix - I think there's a better way of checking for local files than comparing strings. See how g_file_query_default_handler() is implemented: http://git.gnome.org/cgit/glib/tree/gio/gfile.c#n5981 ::: js/misc/docInfo.js @@ +41,2 @@ + if (this.uri.substring(0, 7) == "file://") { + needsUri = false; So, should be: let needsUri = Gio.file_new_for_uri(uri).get_path() == null;
Created attachment 147568 [details] [review] updated patch Awesome, thanks for the pointer. Here's an updated patch.
Review of attachment 147568 [details] [review]: Looks good to me except for one minor typo ::: js/misc/docInfo.js @@ +37,3 @@ // because that would duplicate the work of retrieving the // mime type. + let needsUri = Gio.file_new_for_uri(uri).get_path() == null;; Double semi-colon
Comment on attachment 147568 [details] [review] updated patch pushed to master with that fix, and the missing 'this.', so much for editorial changes after testing =), thanks for the review