[gnome-text-editor: 1/2] application: append user local search path for styles




commit c7f69e277cc42416b65b164c489bcaf0c242e9bd
Author: Günther Wagner <info gunibert de>
Date:   Mon Jan 24 12:14:07 2022 +0100

    application: append user local search path for styles
    
    This enables user style schemes in GTE

 src/editor-application.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/editor-application.c b/src/editor-application.c
index 4b8bbbd..72dbb61 100644
--- a/src/editor-application.c
+++ b/src/editor-application.c
@@ -285,6 +285,7 @@ editor_application_startup (GApplication *application)
   EditorApplication *self = (EditorApplication *)application;
   GtkSourceStyleSchemeManager *schemes;
   g_autoptr(GVariant) all = NULL;
+  g_autofree char *style_path = NULL;
   AdwStyleManager *style_manager;
   GdkDisplay *display;
 
@@ -332,6 +333,9 @@ editor_application_startup (GApplication *application)
 
   schemes = gtk_source_style_scheme_manager_get_default ();
   gtk_source_style_scheme_manager_append_search_path (schemes, PACKAGE_DATADIR"/styles");
+  /* add also the user local style folder which is different from the flatpak style folder */
+  style_path = g_build_filename (g_get_home_dir (), ".local", "share", "gtksourceview-5", "styles", NULL);
+  gtk_source_style_scheme_manager_append_search_path (schemes, style_path);
 
   style_manager = adw_style_manager_get_default ();
 


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