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-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>
* 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);
if (is_icon)
g_object_set (G_OBJECT (cell),
"pixbuf", gtk_image_get_pixbuf (GTK_IMAGE (widget->class->icon)),
NULL);
{
if (gtk_image_get_storage_type GTK_IMAGE (widget->class->icon) != GTK_IMAGE_PIXBUF)
return;
g_object_set (G_OBJECT (cell), "pixbuf",
gtk_image_get_pixbuf (GTK_IMAGE (widget->class->icon)), NULL);
}
else
g_object_set (G_OBJECT (cell),
"text", widget->name,
NULL);
{
g_object_set (G_OBJECT (cell), "text", widget->name, NULL);
}
}
static void