From 8708504c28caeee4bd3e95b6b6d739970863f19c Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Sun, 19 Nov 2006 14:52:38 +0000 Subject: Started working on report generation without GUI. --- hardinfo2/iconcache.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'hardinfo2/iconcache.c') diff --git a/hardinfo2/iconcache.c b/hardinfo2/iconcache.c index 55e98e14..9cb5a035 100644 --- a/hardinfo2/iconcache.c +++ b/hardinfo2/iconcache.c @@ -32,6 +32,8 @@ GdkPixbuf *icon_cache_get_pixbuf(const gchar *file) { GdkPixbuf *icon; + if (!cache) icon_cache_init(); + icon = g_hash_table_lookup(cache, file); if (!icon) { @@ -48,7 +50,7 @@ GdkPixbuf *icon_cache_get_pixbuf(const gchar *file) GtkWidget *icon_cache_get_image(const gchar *file) { GdkPixbuf *icon; - + icon = icon_cache_get_pixbuf(file); return gtk_image_new_from_pixbuf(icon); } @@ -57,6 +59,8 @@ GdkPixbuf *icon_cache_get_pixbuf_at_size(const gchar *file, gint wid, gint hei) { GdkPixbuf *icon; + if (!cache) icon_cache_init(); + icon = g_hash_table_lookup(cache, file); if (!icon) { -- cgit v1.2.3