gtk+ r21651 - in branches/gtk-2-14: . gtk



Author: matthiasc
Date: Tue Oct 14 03:49:18 2008
New Revision: 21651
URL: http://svn.gnome.org/viewvc/gtk+?rev=21651&view=rev

Log:
2008-10-13  Matthias Clasen  <mclasen redhat com>

        Bug 555779 â GtkCellRendererPixbuf crashed on failed GIcon lookup

        * gtk/gtkcellrendererpixbuf
        (gtk_cell_renderer_pixbuf_create_themed_pixbuf): Don't crash
        if a GIcon is not present in the current theme. Patch by
        Alex Larsson.



Modified:
   branches/gtk-2-14/ChangeLog
   branches/gtk-2-14/gtk/gtkcellrendererpixbuf.c

Modified: branches/gtk-2-14/gtk/gtkcellrendererpixbuf.c
==============================================================================
--- branches/gtk-2-14/gtk/gtkcellrendererpixbuf.c	(original)
+++ branches/gtk-2-14/gtk/gtkcellrendererpixbuf.c	Tue Oct 14 03:49:18 2008
@@ -454,8 +454,16 @@
                                              priv->gicon,
 			                     MIN (width, height), 
                                              GTK_ICON_LOOKUP_USE_BUILTIN);
-      cellpixbuf->pixbuf = gtk_icon_info_load_icon (info, &error);
-      gtk_icon_info_free (info);
+      if (!info)
+        {
+          g_set_error (&error, GTK_ICON_THEME_ERROR,  GTK_ICON_THEME_NOT_FOUND,
+                       _("Icon not present in theme"));
+        }
+      else
+        {
+          cellpixbuf->pixbuf = gtk_icon_info_load_icon (info, &error);
+          gtk_icon_info_free (info);
+        }
     }
 
   if (!cellpixbuf->pixbuf) 



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