[Guifications-commits] CVS: guifications2/src gf_stock.c,1.5,1.6
Brought to you by:
amc_grim,
rekkanoryo
From: Gary K. <amc...@us...> - 2004-12-22 02:29:51
|
Update of /cvsroot/guifications/guifications2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23539 Modified Files: gf_stock.c Log Message: a little fault tolerance never hurt no one.. Index: gf_stock.c =================================================================== RCS file: /cvsroot/guifications/guifications2/src/gf_stock.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -p -r1.5 -r1.6 --- gf_stock.c 28 Nov 2004 22:10:06 -0000 1.5 +++ gf_stock.c 22 Dec 2004 02:29:42 -0000 1.6 @@ -21,6 +21,9 @@ #endif #include <gtk/gtk.h> + +#include <debug.h> + #include "gf_stock.h" static GtkIconFactory *icon_factory; @@ -35,12 +38,19 @@ static void gf_add_to_stock(const gchar *file_name, const gchar *stock_name) { GtkIconSet *icon_set; GdkPixbuf *pixbuf; + GError *error; gchar *file; file = gf_stock_file_name(file_name); - pixbuf = gdk_pixbuf_new_from_file(file, NULL); + pixbuf = gdk_pixbuf_new_from_file(file, &error); g_free(file); + if(!pixbuf) { + gaim_debug_info("guifications", "stock error %d: %s\n", + error->code, error->message); + return; + } + icon_set = gtk_icon_set_new_from_pixbuf(pixbuf); g_object_unref(G_OBJECT(pixbuf)); |