Improve a warning Always set the error when returning NULL. (#440982,

2007-05-25  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkiconfactory.c: Improve a warning
        * gtk/gtkicontheme.c (gtk_icon_info_load_icon): Always
        set the error when returning NULL.  (#440982, Carlos Garcia
        Campos)



svn path=/trunk/; revision=17912
This commit is contained in:
Matthias Clasen 2007-05-25 15:31:28 +00:00 committed by Matthias Clasen
parent f42be73710
commit 11e2767fbd
3 changed files with 19 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2007-05-25 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkiconfactory.c: Improve a warning
* gtk/gtkicontheme.c (gtk_icon_info_load_icon): Always
set the error when returning NULL. (#440982, Carlos Garcia
Campos)
2007-05-25 Michael Natterer <mitch@imendio.com>
Merge fix from maemo-gtk:

View File

@ -1467,7 +1467,8 @@ render_icon_name_pixbuf (GtkIconSource *icon_source,
if (!tmp_pixbuf)
{
g_warning ("Error loading theme icon for stock: %s", error->message);
g_warning ("Error loading theme icon '%s' for stock: %s",
icon_source->source.icon_name, error->message);
g_error_free (error);
return NULL;
}

View File

@ -2905,12 +2905,17 @@ gtk_icon_info_load_icon (GtkIconInfo *icon_info,
g_return_val_if_fail (icon_info != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
icon_info_ensure_scale_and_pixbuf (icon_info, FALSE);
if (icon_info->load_error)
if (!icon_info_ensure_scale_and_pixbuf (icon_info, FALSE))
{
g_propagate_error (error, icon_info->load_error);
return NULL;
if (icon_info->load_error)
g_propagate_error (error, icon_info->load_error);
else
g_set_error (error,
GTK_ICON_THEME_ERROR,
GTK_ICON_THEME_NOT_FOUND,
_("Failed to load icon"));
return NULL;
}
return g_object_ref (icon_info->pixbuf);