From fcfe968ab56dfa2493265a83a1227c2849328a63 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Tue, 10 Oct 2000 23:58:49 +0000 Subject: Handle missing icons better. svn path=/trunk/; revision=5827 --- composer/e-msg-composer-attachment-bar.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'composer/e-msg-composer-attachment-bar.c') diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c index 3743c310af..0a7428b2ea 100644 --- a/composer/e-msg-composer-attachment-bar.c +++ b/composer/e-msg-composer-attachment-bar.c @@ -305,7 +305,22 @@ update (EMsgComposerAttachmentBar *bar) if (image) { e_icon_list_append_pixbuf (icon_list, attachment->pixbuf_cache, icon_name, label); } else { - e_icon_list_append (icon_list, icon_name, label); + if (icon_name) + pixbuf = gdk_pixbuf_new_from_file (icon_name); + else + pixbuf = NULL; + + /* Get the default */ + if (pixbuf == NULL) { + icon_name = gnome_vfs_mime_get_value ("text/plain", + "icon-filename"); + if (icon_name != NULL) + pixbuf = gdk_pixbuf_new_from_file (icon_name); + } + e_icon_list_append_pixbuf (icon_list, pixbuf, + icon_name, label); + if (pixbuf) + gdk_pixbuf_unref (pixbuf); } g_free (label); -- cgit v1.2.3