Don't crash if the widget doesn't have a valid icon.

This commit is contained in:
Paolo Borelli 2004-01-15 08:16:40 +00:00
parent 50313bb5eb
commit a2ac8937bf
2 changed files with 15 additions and 6 deletions

View File

@ -61,6 +61,11 @@
* src/glade-utils.c: missing include. * src/glade-utils.c: missing include.
* src/glade-placeholder: missing include. * src/glade-placeholder: missing include.
2004-01-15 Paolo Borelli <pborelli@katamail.com>
* src/glade-project-view.c: don't crash im the widget doesn't have
a valid icon.
2003-11-13 Paolo Borelli <pborelli@katamail.com> 2003-11-13 Paolo Borelli <pborelli@katamail.com>
* src/glade-command.c: free the value of the set property command in the * src/glade-command.c: free the value of the set property command in the

View File

@ -427,13 +427,17 @@ glade_project_view_cell_function (GtkTreeViewColumn *tree_column,
g_return_if_fail (widget->class->icon != NULL); g_return_if_fail (widget->class->icon != NULL);
if (is_icon) if (is_icon)
g_object_set (G_OBJECT (cell), {
"pixbuf", gtk_image_get_pixbuf (GTK_IMAGE (widget->class->icon)), if (gtk_image_get_storage_type GTK_IMAGE (widget->class->icon) != GTK_IMAGE_PIXBUF)
NULL); return;
g_object_set (G_OBJECT (cell), "pixbuf",
gtk_image_get_pixbuf (GTK_IMAGE (widget->class->icon)), NULL);
}
else else
g_object_set (G_OBJECT (cell), {
"text", widget->name, g_object_set (G_OBJECT (cell), "text", widget->name, NULL);
NULL); }
} }
static void static void