aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-02-06 01:59:45 +0800
committerMilan Crha <mcrha@src.gnome.org>2009-02-06 01:59:45 +0800
commit9d6d160565c04b0b6f4318fa2ef388c797e6ea27 (patch)
tree92a151043b28354bb67f2137d455f0e5f97282dd /mail/em-format.c
parenta6603389521c48a37e421b95255d62a3585cd6e5 (diff)
downloadgsoc2013-evolution-9d6d160565c04b0b6f4318fa2ef388c797e6ea27.tar.gz
gsoc2013-evolution-9d6d160565c04b0b6f4318fa2ef388c797e6ea27.tar.zst
gsoc2013-evolution-9d6d160565c04b0b6f4318fa2ef388c797e6ea27.zip
** Part of fix for bug #554458
2009-02-05 Milan Crha <mcrha@redhat.com> ** Part of fix for bug #554458 * em-format.c: (em_format_describe_part): Make content type from a mime type first. svn path=/trunk/; revision=37228
Diffstat (limited to 'mail/em-format.c')
-rw-r--r--mail/em-format.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/mail/em-format.c b/mail/em-format.c
index a9ec0935d3..89445ab35a 100644
--- a/mail/em-format.c
+++ b/mail/em-format.c
@@ -1151,11 +1151,12 @@ em_format_describe_part(CamelMimePart *part, const char *mime_type)
{
GString *stext;
const char *filename, *description;
- char *out, *desc;
+ char *content_type, *desc;
stext = g_string_new("");
- /* TODO: mime_type isn't content_type on some systems (Win32), thus this will not work there. */
- desc = g_content_type_get_description (mime_type);
+ content_type = g_content_type_from_mime_type (mime_type);
+ desc = g_content_type_get_description (content_type ? content_type : mime_type);
+ g_free (content_type);
g_string_append_printf (stext, _("%s attachment"), desc ? desc : mime_type);
g_free (desc);
if ((filename = camel_mime_part_get_filename (part)))
@@ -1165,10 +1166,7 @@ em_format_describe_part(CamelMimePart *part, const char *mime_type)
!(filename && (strcmp(filename, description) == 0)))
g_string_append_printf(stext, ", \"%s\"", description);
- out = stext->str;
- g_string_free(stext, FALSE);
-
- return out;
+ return g_string_free (stext, FALSE);
}
/* ********************************************************************** */