inspector: Look for icon themes in system data dirs
authorMatthias Clasen <mclasen@redhat.com>
Tue, 28 Feb 2023 12:18:42 +0000 (07:18 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 28 Feb 2023 12:18:42 +0000 (07:18 -0500)
For some reason, these were not included, and they should.

gtk/inspector/visual.c

index f0ac13411308327434be861f0b400c3323b97c03..43f9225adf8c5048a8f8f267246385eaaae97885 100644 (file)
@@ -630,6 +630,8 @@ fill_icons (const char *path,
   const char *dir_entry;
   GDir *dir;
 
+  g_print ("fill icons from %s\n", path);
+
   dir = g_dir_open (path, 0, NULL);
   if (!dir)
     return;
@@ -658,6 +660,7 @@ init_icons (GtkInspectorVisual *vis)
   GList *list, *l;
   int i;
   GtkStringList *names;
+  const char * const *dirs;
 
   t = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
 
@@ -669,6 +672,14 @@ init_icons (GtkInspectorVisual *vis)
   fill_icons (path, t);
   g_free (path);
 
+  dirs = g_get_system_data_dirs ();
+  for (i = 0; dirs[i]; i++)
+    {
+      path = g_build_filename (dirs[i], "icons", NULL);
+      fill_icons (path, t);
+      g_free (path);
+    }
+
   list = NULL;
   g_hash_table_iter_init (&iter, t);
   while (g_hash_table_iter_next (&iter, (gpointer *)&theme, NULL))
@@ -723,6 +734,7 @@ init_cursors (GtkInspectorVisual *vis)
   GList *list, *l;
   GtkStringList *names;
   int i;
+  const char * const *dirs;
 
   t = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
 
@@ -734,6 +746,14 @@ init_cursors (GtkInspectorVisual *vis)
   fill_cursors (path, t);
   g_free (path);
 
+  dirs = g_get_system_data_dirs ();
+  for (i = 0; dirs[i]; i++)
+    {
+      path = g_build_filename (dirs[i], "icons", NULL);
+      fill_cursors (path, t);
+      g_free (path);
+    }
+
   list = NULL;
   g_hash_table_iter_init (&iter, t);
   while (g_hash_table_iter_next (&iter, (gpointer *)&theme, NULL))