Package: gnome-shell
Version: 2.28.1~git20091028-1
Severity: normal
Tags: patch

The actual reason here is thad docInfo.js only selects applications that
claim to be able to handle URIs. Since glib (as of 2.20, see devhelp of
GAppInfo) converts this to a local path anyway (when possible) this is
not necessary especially not for local files. Attached patch drops that
requirement local files.
Cheers,
 -- Guido

>From f8e38b4198dc6da0b7a07f019efd84df293f363b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <[email protected]>
Date: Sun, 1 Nov 2009 15:46:28 +0100
Subject: [PATCH] don't require an application to accept an uri

when it's not needed. This fixes the case where we want to handle e.g.
text files with gvim which doesn't support URIs.
---
 js/misc/docInfo.js |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/js/misc/docInfo.js b/js/misc/docInfo.js
index 021dce4..4abd050 100644
--- a/js/misc/docInfo.js
+++ b/js/misc/docInfo.js
@@ -36,8 +36,13 @@ DocInfo.prototype = {
         // shorter in terms of lines of code, we are not doing so
         // because that would duplicate the work of retrieving the
         // mime type.
+        let needsUri = true;
 
-        let appInfo = Gio.app_info_get_default_for_type(this.mimeType, true);
+        if  (this.uri.match("^file://")) {
+                needsUri = false;
+        }
+
+        let appInfo = Gio.app_info_get_default_for_type(this.mimeType, needsUri);
 
         if (appInfo != null) {
             appInfo.launch_uris([this.uri], Main.createAppLaunchContext());
-- 
1.6.5.2

Reply via email to