[gedit] snippets: load system snippets on windows too



commit 84ff7616bb916c259ce9401250889672c5187355
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Fri Aug 22 17:41:29 2014 +0200

    snippets: load system snippets on windows too

 plugins/snippets/snippets/appactivatable.py |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/plugins/snippets/snippets/appactivatable.py b/plugins/snippets/snippets/appactivatable.py
index 6ebf00d..7ac0bf9 100644
--- a/plugins/snippets/snippets/appactivatable.py
+++ b/plugins/snippets/snippets/appactivatable.py
@@ -92,17 +92,18 @@ class AppActivatable(GObject.Object, Gedit.AppActivatable):
     def system_dirs(self):
         dirs = []
 
-        if platform.system() != 'Windows':
-            if 'XDG_DATA_DIRS' in os.environ:
-                datadirs = os.environ['XDG_DATA_DIRS']
-            else:
-                datadirs = '/usr/local/share' + os.pathsep + '/usr/share'
+        if 'XDG_DATA_DIRS' in os.environ:
+            datadirs = os.environ['XDG_DATA_DIRS']
+        elif platform.system() != 'Windows':
+            datadirs = '/usr/local/share' + os.pathsep + '/usr/share'
+        else:
+            datadirs = GLib.win32_get_package_installation_directory_of_module(None)
 
-            for d in datadirs.split(os.pathsep):
-                d = os.path.join(d, 'gedit', 'plugins', 'snippets')
+        for d in datadirs.split(os.pathsep):
+            d = os.path.join(d, 'gedit', 'plugins', 'snippets')
 
-                if os.path.isdir(d):
-                    dirs.append(d)
+            if os.path.isdir(d):
+                dirs.append(d)
 
         dirs.append(self.plugin_info.get_data_dir())
         return dirs


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]