[glade/glade-3-20] GladeApp: add GLADE_ENV_ICON_THEME_PATH



commit 3d7f30d64378dc0cc0d58326b6cbacfda3258415
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Sun Oct 1 21:21:38 2017 -0300

    GladeApp: add GLADE_ENV_ICON_THEME_PATH
    
    Add env variable to append extra icon theme search paths

 gladeui/glade-app.c |   18 ++++++++++++++++--
 gladeui/glade-app.h |    1 +
 2 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/gladeui/glade-app.c b/gladeui/glade-app.c
index e117d88..5dfb37e 100644
--- a/gladeui/glade-app.c
+++ b/gladeui/glade-app.c
@@ -371,8 +371,22 @@ glade_app_init (GladeApp *app)
 
   if (!initialized)
     {
-      gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
-                                         pixmaps_dir);
+      GtkIconTheme *default_icon_theme = gtk_icon_theme_get_default ();
+      const gchar *path;
+
+      gtk_icon_theme_append_search_path (default_icon_theme, pixmaps_dir);
+
+      /* Handle extra icon theme paths. Needed for tests to work */
+      if ((path = g_getenv (GLADE_ENV_ICON_THEME_PATH)))
+        {
+          gchar **tokens = g_strsplit (path, ":", -1);
+          gint i;
+
+          for (i = 0; tokens[i]; i++)
+            gtk_icon_theme_append_search_path (default_icon_theme, tokens[i]);
+
+          g_strfreev (tokens);
+        }
 
       glade_cursor_init ();
 
diff --git a/gladeui/glade-app.h b/gladeui/glade-app.h
index 5b5a81b..5c10bff 100644
--- a/gladeui/glade-app.h
+++ b/gladeui/glade-app.h
@@ -40,6 +40,7 @@ G_BEGIN_DECLS
 #define GLADE_ENV_MODULE_PATH      "GLADE_MODULE_SEARCH_PATH"
 #define GLADE_ENV_TESTING          "GLADE_TESTING"
 #define GLADE_ENV_PIXMAP_DIR       "GLADE_PIXMAP_DIR"
+#define GLADE_ENV_ICON_THEME_PATH  "GLADE_ICON_THEME_PATH"
 #define GLADE_ENV_BUNDLED          "GLADE_BUNDLED"
 
 typedef struct _GladeApp         GladeApp;


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