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 601287 - should not require support for URIs from apps when openning files from the recent files list
should not require support for URIs from apps when openning files from the re...
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-11-09 18:09 UTC by Gustavo Noronha (kov)
Modified: 2009-11-12 16:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed fix (1.26 KB, patch)
2009-11-09 18:09 UTC, Gustavo Noronha (kov)
needs-work Details | Review
updated patch (1.38 KB, patch)
2009-11-12 12:34 UTC, Gustavo Noronha (kov)
committed Details | Review

Description Gustavo Noronha (kov) 2009-11-09 18:09:45 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.
Comment 1 Gustavo Noronha (kov) 2009-11-09 18:11:01 UTC
Just to clarify, the patch drops the requirement for file:// paths only, but I suggest considering droping the requirement for all URI schemes.
Comment 2 Owen Taylor 2009-11-10 21:57:14 UTC
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;
Comment 3 Gustavo Noronha (kov) 2009-11-12 12:34:25 UTC
Created attachment 147568 [details] [review]
updated patch

Awesome, thanks for the pointer. Here's an updated patch.
Comment 4 Owen Taylor 2009-11-12 16:15:19 UTC
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 5 Gustavo Noronha (kov) 2009-11-12 16:27:40 UTC
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