From 994243e216d8349af1a416e9222f4f66f4c45b12 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 3 Jul 2003 12:29:24 +0000 Subject: Gone (pixbuf_gen_idle): Use e_icon_for_mime_type instead. * mail-display.c (pixbuf_for_mime_type): Gone (pixbuf_gen_idle): Use e_icon_for_mime_type instead. svn path=/trunk/; revision=21736 --- mail/ChangeLog | 5 +++++ mail/mail-display.c | 60 ++--------------------------------------------------- 2 files changed, 7 insertions(+), 58 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index d682cae826..48e05806ef 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +2003-07-01 Dan Winship + + * mail-display.c (pixbuf_for_mime_type): Gone + (pixbuf_gen_idle): Use e_icon_for_mime_type instead. + 2003-06-27 Jeffrey Stedfast * message-list.c (filter_date): Use the newer utf8 versions of the diff --git a/mail/mail-display.c b/mail/mail-display.c index 543ff7279b..634542cd51 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -41,7 +41,6 @@ #include #include -#include #include #include #include @@ -65,6 +64,7 @@ #include +#include "e-util/e-gui-utils.h" #include "e-util/e-mktemp.h" #include "addressbook/backend/ebook/e-book-util.h" @@ -81,8 +81,6 @@ #include "camel/camel-data-cache.h" -#include "art/empty.xpm" - #define d(x) struct _MailDisplayPrivate { @@ -549,60 +547,6 @@ pixmap_press (GtkWidget *widget, GdkEventButton *event, gpointer user_data) return TRUE; } -static GdkPixbuf * -pixbuf_for_mime_type (const char *mime_type) -{ - const char *icon_name; - char *filename = NULL; - GdkPixbuf *pixbuf = NULL; - - icon_name = gnome_vfs_mime_get_icon (mime_type); - - if (icon_name) { - if (*icon_name == '/') { - pixbuf = gdk_pixbuf_new_from_file (icon_name, NULL); - if (pixbuf) - return pixbuf; - } - - filename = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP, - icon_name, TRUE, NULL); - if (!filename) { - char *fm_icon; - - fm_icon = g_strdup_printf ("nautilus/%s", icon_name); - filename = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP, - fm_icon, TRUE, NULL); - if (!filename) { - g_free (fm_icon); - fm_icon = g_strdup_printf ("mc/%s", icon_name); - filename = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP, - fm_icon, TRUE, NULL); - } - g_free (fm_icon); - } - - if (filename) { - pixbuf = gdk_pixbuf_new_from_file (filename, NULL); - g_free (filename); - } - } - - if (!pixbuf) { - filename = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP, - "gnome-unknown.png", TRUE, NULL); - if (filename) { - pixbuf = gdk_pixbuf_new_from_file (filename, NULL); - g_free (filename); - } else { - g_warning ("Could not get any icon for %s!",mime_type); - pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)empty_xpm); - } - } - - return pixbuf; -} - static gboolean pixbuf_uncache (gpointer key) { @@ -686,7 +630,7 @@ pixbuf_gen_idle (struct _PixbufLoader *pbl) if (error || !pbl->mstream) { if (pbl->type) - pixbuf = pixbuf_for_mime_type (pbl->type); + pixbuf = e_icon_for_mime_type (pbl->type, 24); else pixbuf = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/pgp-signature-nokey.png", NULL); } else -- cgit v1.2.3