[gimp/wip/Jehan/layers-dockable-refresh: 111/126] app: special-case icon theme loading when testing build.




commit b6f3c00dbfdeb8cb720a40ff9f9f3b7ada1b0886
Author: Jehan <jehan girinstud io>
Date:   Tue Nov 2 16:15:47 2021 +0100

    app: special-case icon theme loading when testing build.
    
    It's a bit ugly, but it's not like this is run many times (only once
    when loading the icon theme, or changing it).
    
    Fixes this error appearing in various unit tests' output:
    
    > gimp_icons_sanity_check: Icon theme path has no 'hicolor' subdirectory: 
/builds/GNOME/gimp/_install/share/gimp/2.99/icons
    
    (even though it was not a test-failure error, it's still better to limit
    output for debugging)

 app/gui/icon-themes.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
---
diff --git a/app/gui/icon-themes.c b/app/gui/icon-themes.c
index 27c39ebc30..3fd1bfac2c 100644
--- a/app/gui/icon-themes.c
+++ b/app/gui/icon-themes.c
@@ -219,7 +219,24 @@ icons_apply_theme (Gimp        *gimp,
   if (gimp->be_verbose)
     g_print ("Loading icon theme '%s'\n", icon_theme_name);
 
-  gimp_icons_set_icon_theme (icon_themes_get_theme_dir (gimp, icon_theme_name));
+  if (g_getenv ("GIMP_TESTING_ABS_TOP_SRCDIR"))
+    {
+      GFile *file;
+      gchar *path;
+
+      path = g_build_filename (g_getenv ("GIMP_TESTING_ABS_TOP_SRCDIR"),
+                               "icons", icon_theme_name, NULL);
+      file = g_file_new_for_path (path);
+
+      gimp_icons_set_icon_theme (file);
+
+      g_object_unref (file);
+      g_free (path);
+    }
+  else
+    {
+      gimp_icons_set_icon_theme (icon_themes_get_theme_dir (gimp, icon_theme_name));
+    }
 }
 
 static void


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