[gimp/wip/Jehan/incremental-win-installer-improvements: 3/3] Test!




commit 8c0853278db6dbfc04efac45bbea2f6ea7136c3d
Author: Jehan <jehan girinstud io>
Date:   Wed Jul 7 14:03:09 2021 +0200

    Test!

 libgimpwidgets/gimpwidgets-private.c | 40 ++++++++++++++++++++++++------------
 1 file changed, 27 insertions(+), 13 deletions(-)
---
diff --git a/libgimpwidgets/gimpwidgets-private.c b/libgimpwidgets/gimpwidgets-private.c
index 1ce357c971..848348e5f4 100644
--- a/libgimpwidgets/gimpwidgets-private.c
+++ b/libgimpwidgets/gimpwidgets-private.c
@@ -69,6 +69,7 @@ gimp_widgets_init (GimpHelpFunc          standard_help_func,
   gchar       *base_dir;
   gchar       *path;
   GdkPixbuf   *pixbuf;
+  GError      *error = NULL;
 
   g_return_if_fail (standard_help_func != NULL);
 
@@ -98,39 +99,51 @@ gimp_widgets_init (GimpHelpFunc          standard_help_func,
    * least, we want the installed icon.
    */
   path   = g_build_filename (base_dir, "16x16/apps/gimp.png", NULL);
-  pixbuf = gdk_pixbuf_new_from_file (DATAROOTDIR "/icons/hicolor/16x16/apps/gimp.png", NULL);
+  pixbuf = gdk_pixbuf_new_from_file (DATAROOTDIR "/icons/hicolor/16x16/apps/gimp.png", &error);
   if (pixbuf)
     icons = g_list_prepend (icons, pixbuf);
   else
-    g_printerr ("Application icon missing: %s", path);
+    {
+      g_printerr ("Application icon missing: %s (%s)\n", path, error->message);
+      g_clear_error (&error);
+    }
   g_free (path);
 
-  path   = g_build_filename (base_dir, "32x32/apps/gimp.png", NULL);
-  pixbuf = gdk_pixbuf_new_from_file (DATAROOTDIR "/icons/hicolor/32x32/apps/gimp.png", NULL);
+  path   = g_build_filename (base_dir, "32x32", "apps", "gimp.png", NULL);
+  pixbuf = gdk_pixbuf_new_from_file (DATAROOTDIR "/icons/hicolor/32x32/apps/gimp.png", &error);
   if (pixbuf)
     icons = g_list_prepend (icons, pixbuf);
   else
-    g_printerr ("Application icon missing: %s", path);
+    {
+      g_printerr ("Application icon missing: %s (%s)\n", path, error->message);
+      g_clear_error (&error);
+    }
   g_free (path);
 
-  path   = g_build_filename (base_dir, "48x48/apps/gimp.png", NULL);
-  pixbuf = gdk_pixbuf_new_from_file (DATAROOTDIR "/icons/hicolor/48x48/apps/gimp.png", NULL);
+  path   = g_build_filename (base_dir, "48x48\\apps\\gimp.png", NULL);
+  pixbuf = gdk_pixbuf_new_from_file (DATAROOTDIR "/icons/hicolor/48x48/apps/gimp.png", &error);
   if (pixbuf)
     icons = g_list_prepend (icons, pixbuf);
   else
-    g_printerr ("Application icon missing: %s", path);
+    {
+      g_printerr ("Application icon missing: %s (%s)\n", path, error->message);
+      g_clear_error (&error);
+    }
   g_free (path);
 
   path   = g_build_filename (base_dir, "64x64/apps/gimp.png", NULL);
-  pixbuf = gdk_pixbuf_new_from_file (DATAROOTDIR "/icons/hicolor/64x64/apps/gimp.png", NULL);
+  pixbuf = gdk_pixbuf_new_from_file (DATAROOTDIR "/icons/hicolor/64x64/apps/gimp.png", &error);
   if (pixbuf)
     icons = g_list_prepend (icons, pixbuf);
   else
-    g_printerr ("Application icon missing: %s", path);
+    {
+      g_printerr ("Application icon missing: %s (%s)\n", path, error->message);
+      g_clear_error (&error);
+    }
   g_free (path);
 
   path   = g_build_filename (base_dir, "scalable/apps/gimp.svg", NULL);
-  pixbuf = gdk_pixbuf_new_from_file_at_size (path, 128, 128, NULL);
+  pixbuf = gdk_pixbuf_new_from_file_at_size (path, 128, 128, &error);
   if (pixbuf)
     {
       /* Various common sizes from the same SVG. Why I go into such
@@ -157,7 +170,8 @@ gimp_widgets_init (GimpHelpFunc          standard_help_func,
     }
   else
     {
-      g_printerr ("Application icon missing: %s", path);
+      g_printerr ("Application icon missing: %s (%s)\n", path, error->message);
+      g_clear_error (&error);
     }
   g_free (path);
 
@@ -166,7 +180,7 @@ gimp_widgets_init (GimpHelpFunc          standard_help_func,
   if (pixbuf)
     icons = g_list_prepend (icons, pixbuf);
   else
-    g_printerr ("Application icon missing: %s", path);
+    g_printerr ("Application icon missing: %s\n", path);
   g_free (path);
 
   gtk_window_set_default_icon_list (icons);


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