diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-02-04 03:07:48 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-02-04 03:07:48 +0800 |
commit | d2f0410b09bd00e167b5de81977d96e48d044a2e (patch) | |
tree | befeb56ef188b2ffa80e71b29f38f5f07f1136f7 /mail/mail-identify.c | |
parent | aa078aa5fc5e30bf32793965a95431ee7cd10d5c (diff) | |
download | gsoc2013-evolution-d2f0410b09bd00e167b5de81977d96e48d044a2e.tar gsoc2013-evolution-d2f0410b09bd00e167b5de81977d96e48d044a2e.tar.gz gsoc2013-evolution-d2f0410b09bd00e167b5de81977d96e48d044a2e.tar.bz2 gsoc2013-evolution-d2f0410b09bd00e167b5de81977d96e48d044a2e.tar.lz gsoc2013-evolution-d2f0410b09bd00e167b5de81977d96e48d044a2e.tar.xz gsoc2013-evolution-d2f0410b09bd00e167b5de81977d96e48d044a2e.tar.zst gsoc2013-evolution-d2f0410b09bd00e167b5de81977d96e48d044a2e.zip |
Just use gnome_vfs_get_mime_type_from_name() so we can forget all the crap
2003-02-03 Jeffrey Stedfast <fejj@ximian.com>
* mail-identify.c (mail_identify_mime_part): Just use
gnome_vfs_get_mime_type_from_name() so we can forget all the crap
I implemented before.
2003-02-01 Jeffrey Stedfast <fejj@ximian.com>
* mail-display.c (on_link_clicked): Pass in the *address* of the
GError to gnome_url_show(), otherwise bad things happen :-)
svn path=/trunk/; revision=19711
Diffstat (limited to 'mail/mail-identify.c')
-rw-r--r-- | mail/mail-identify.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/mail/mail-identify.c b/mail/mail-identify.c index 0ef8b7e9e3..c51831fc63 100644 --- a/mail/mail-identify.c +++ b/mail/mail-identify.c @@ -53,7 +53,6 @@ mail_identify_mime_part (CamelMimePart *part, MailDisplay *md) const char *filename, *magic_type = NULL; CamelDataWrapper *data; char *name_type = NULL; - char *uri; filename = camel_mime_part_get_filename (part); if (filename) { @@ -61,15 +60,13 @@ mail_identify_mime_part (CamelMimePart *part, MailDisplay *md) if (!strcmp (filename, "winmail.dat")) return g_strdup ("application/vnd.ms-tnef"); - uri = gnome_vfs_get_uri_from_local_path (filename); - name_type = gnome_vfs_get_mime_type (uri); - g_free (uri); + name_type = gnome_vfs_get_mime_type_from_name (filename); } - + data = camel_medium_get_content_object (CAMEL_MEDIUM (part)); if (!camel_data_wrapper_is_offline (data)) magic_type = identify_by_magic (data, md); - + if (magic_type && name_type) { /* If GNOME-VFS doesn't recognize the data by magic, but it * contains English words, it will call it text/plain. If the @@ -78,31 +75,31 @@ mail_identify_mime_part (CamelMimePart *part, MailDisplay *md) */ if (!strcmp (magic_type, "text/plain")) return name_type; - + /* If if returns "application/octet-stream" try to * do better with the filename check. */ if (!strcmp (magic_type, "application/octet-stream")) return name_type; } - + /* If the MIME part data was online, and the magic check * returned something, use that, since it's more reliable. */ if (magic_type) { - g_free(name_type); + g_free (name_type); return g_strdup (magic_type); } - + /* Otherwise try guessing based on the filename */ if (name_type) return name_type; - + /* Another possibility to try is the x-mac-type / x-mac-creator * parameter to Content-Type used by some Mac email clients. That * would require a Mac type to mime type conversion table. */ - + #if 0 /* If the data part is offline, then we didn't try magic * before, so force it to be loaded so we can try again later. @@ -114,7 +111,7 @@ mail_identify_mime_part (CamelMimePart *part, MailDisplay *md) if (camel_data_wrapper_is_offline (data)) mail_content_loaded (data, md, TRUE, NULL, NULL, NULL); #endif - + return NULL; } |