aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo Noronha Silva <gustavo.noronha@collabora.co.uk>2010-01-23 04:15:17 +0800
committerGustavo Noronha Silva <gustavo.noronha@collabora.co.uk>2010-01-23 04:40:52 +0800
commit7173ba4e07cb964fd5a8c340dedf20e0b4c61aab (patch)
treebbbfdafb13412f899c52ae3c7eb1001cc681d4cd
parent4493e21d5b12cb2bab9bb1f30c8917946a2dd0c7 (diff)
downloadgsoc2013-evolution-7173ba4e07cb964fd5a8c340dedf20e0b4c61aab.tar
gsoc2013-evolution-7173ba4e07cb964fd5a8c340dedf20e0b4c61aab.tar.gz
gsoc2013-evolution-7173ba4e07cb964fd5a8c340dedf20e0b4c61aab.tar.bz2
gsoc2013-evolution-7173ba4e07cb964fd5a8c340dedf20e0b4c61aab.tar.lz
gsoc2013-evolution-7173ba4e07cb964fd5a8c340dedf20e0b4c61aab.tar.xz
gsoc2013-evolution-7173ba4e07cb964fd5a8c340dedf20e0b4c61aab.tar.zst
gsoc2013-evolution-7173ba4e07cb964fd5a8c340dedf20e0b4c61aab.zip
Fallback to missing image, when a stock icon could not be found
https://bugzilla.gnome.org/show_bug.cgi?id=607804
-rw-r--r--e-util/e-icon-factory.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/e-util/e-icon-factory.c b/e-util/e-icon-factory.c
index 411deead24..4f4b8d3a40 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;