[evolution] Fallback to missing image, when a stock icon could not be found



commit 7173ba4e07cb964fd5a8c340dedf20e0b4c61aab
Author: Gustavo Noronha Silva <gustavo noronha collabora co uk>
Date:   Fri Jan 22 18:15:17 2010 -0200

    Fallback to missing image, when a stock icon could not be found
    
    https://bugzilla.gnome.org/show_bug.cgi?id=607804

 e-util/e-icon-factory.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/e-util/e-icon-factory.c b/e-util/e-icon-factory.c
index 411deea..4f4b8d3 100644
--- a/e-util/e-icon-factory.c
+++ b/e-util/e-icon-factory.c
@@ -100,14 +100,24 @@ e_icon_factory_get_icon (const gchar *icon_name,
 	icon_theme = gtk_icon_theme_get_default ();
 
 	if (!gtk_icon_size_lookup (icon_size, &width, &height))
-		return NULL;
+		width = height = 16;
 
 	pixbuf = gtk_icon_theme_load_icon (
 		icon_theme, icon_name, height, 0, &error);
 
 	if (error != NULL) {
 		g_warning ("%s", error->message);
-		g_error_free (error);
+		g_clear_error (&error);
+
+		/* Fallback to missing image */
+                pixbuf = gtk_icon_theme_load_icon (
+                        icon_theme, GTK_STOCK_MISSING_IMAGE,
+			height, 0, &error);
+
+                if (error != NULL) {
+			g_error ("%s", error->message);
+			g_clear_error (&error);
+                }
 	}
 
 	return pixbuf;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]