[gnome-builder] app: load gsv styles from .local/share/gedit/styles



commit 8f80843950a3f6d384f14fe916f231b42115e30a
Author: Christian Hergert <chergert redhat com>
Date:   Thu May 5 17:57:44 2016 +0300

    app: load gsv styles from .local/share/gedit/styles
    
    Sometimes users load styles using the Gedit importer. We can certainly
    use those styles too. Probably worth while to patch both gedit and
    Builder to use ~/.local/share/gtksourceview-3.0/styles/ in the future.

 libide/ide-application.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/libide/ide-application.c b/libide/ide-application.c
index 06b2819..0d2626f 100644
--- a/libide/ide-application.c
+++ b/libide/ide-application.c
@@ -152,14 +152,22 @@ ide_application_register_menus (IdeApplication *self)
 static void
 ide_application_register_search_paths (IdeApplication *self)
 {
+  GtkSourceStyleSchemeManager *manager;
+  g_autofree gchar *gedit_path = NULL;
+
   g_assert (IDE_IS_APPLICATION (self));
 
-  gtk_source_style_scheme_manager_append_search_path (gtk_source_style_scheme_manager_get_default (),
+  manager = gtk_source_style_scheme_manager_get_default ();
+
+  gtk_source_style_scheme_manager_append_search_path (manager,
                                                       PACKAGE_DATADIR"/gtksourceview-3.0/styles/");
 
+  /* We can use styles from gedit too */
+  gedit_path = g_build_filename (g_get_user_data_dir (), "gedit", "styles", NULL);
+  gtk_source_style_scheme_manager_append_search_path (manager, gedit_path);
+
   if (g_getenv ("GB_IN_TREE_STYLE_SCHEMES") != NULL)
-    gtk_source_style_scheme_manager_prepend_search_path (gtk_source_style_scheme_manager_get_default (),
-                                                         SRCDIR"/data/style-schemes");
+    gtk_source_style_scheme_manager_prepend_search_path (manager, SRCDIR"/data/style-schemes");
 }
 
 static void


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