Commit 11e2767f authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

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
parent f42be737
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> 2007-05-25 Michael Natterer <mitch@imendio.com>
Merge fix from maemo-gtk: Merge fix from maemo-gtk:
......
...@@ -1467,7 +1467,8 @@ render_icon_name_pixbuf (GtkIconSource *icon_source, ...@@ -1467,7 +1467,8 @@ render_icon_name_pixbuf (GtkIconSource *icon_source,
if (!tmp_pixbuf) 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); g_error_free (error);
return NULL; return NULL;
} }
......
...@@ -2905,12 +2905,17 @@ gtk_icon_info_load_icon (GtkIconInfo *icon_info, ...@@ -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 (icon_info != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL);
icon_info_ensure_scale_and_pixbuf (icon_info, FALSE); if (!icon_info_ensure_scale_and_pixbuf (icon_info, FALSE))
if (icon_info->load_error)
{ {
g_propagate_error (error, icon_info->load_error); if (icon_info->load_error)
return NULL; 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); return g_object_ref (icon_info->pixbuf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment