[meld] melddoc: Fix "Open External" for files on Windows
- From: Kai Willadsen <kaiw src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [meld] melddoc: Fix "Open External" for files on Windows
 
- Date: Sun, 31 Aug 2014 05:39:56 +0000 (UTC)
 
commit cbd4243f2381778d2435836874d4d1eda262d1a1
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Aug 31 09:10:28 2014 +1000
    melddoc: Fix "Open External" for files on Windows
    
    GIO doesn't support URIs for GAppInfo launching on Windows, for...
    some reason.
 meld/melddoc.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/meld/melddoc.py b/meld/melddoc.py
index 83c59ac..c319d10 100644
--- a/meld/melddoc.py
+++ b/meld/melddoc.py
@@ -121,8 +121,13 @@ class MeldDoc(GObject.GObject):
                         sys.platform == "win32":
                     if settings.get_boolean('use-system-editor'):
                         gfile = Gio.File.new_for_path(path)
-                        Gio.AppInfo.launch_default_for_uri(
-                            gfile.get_uri(), None)
+                        if sys.platform == "win32":
+                            handler = gfile.query_default_handler(None)
+                            result = handler.launch([gfile], None)
+                        else:
+                            uri = gfile.get_uri()
+                            Gio.AppInfo.launch_default_for_uri(
+                                uri, None)
                     else:
                         editor = make_custom_editor_command(path, line)
                         if editor:
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]