aboutsummaryrefslogtreecommitdiffstats
path: root/em-format
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-03-10 18:43:25 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:44 +0800
commitba4172f42cd43e98d9ee588e9ece180e7144e1b5 (patch)
tree8b7a68896fdae935a207ac83484e69263b2adfbf /em-format
parent45c0f292624ea40f8b0debf7b5a5f60053c419ef (diff)
downloadgsoc2013-evolution-ba4172f42cd43e98d9ee588e9ece180e7144e1b5.tar
gsoc2013-evolution-ba4172f42cd43e98d9ee588e9ece180e7144e1b5.tar.gz
gsoc2013-evolution-ba4172f42cd43e98d9ee588e9ece180e7144e1b5.tar.bz2
gsoc2013-evolution-ba4172f42cd43e98d9ee588e9ece180e7144e1b5.tar.lz
gsoc2013-evolution-ba4172f42cd43e98d9ee588e9ece180e7144e1b5.tar.xz
gsoc2013-evolution-ba4172f42cd43e98d9ee588e9ece180e7144e1b5.tar.zst
gsoc2013-evolution-ba4172f42cd43e98d9ee588e9ece180e7144e1b5.zip
Use message subject for attachment description if no filename provided
Diffstat (limited to 'em-format')
-rw-r--r--em-format/em-format.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/em-format/em-format.c b/em-format/em-format.c
index e71e2a96a2..a4300a979d 100644
--- a/em-format/em-format.c
+++ b/em-format/em-format.c
@@ -1458,6 +1458,13 @@ em_format_describe_part (CamelMimePart *part,
filename = camel_mime_part_get_filename (part);
description = camel_mime_part_get_description (part);
+ if (!filename || !*filename) {
+ CamelDataWrapper *content = camel_medium_get_content (CAMEL_MEDIUM (part));
+
+ if (content && CAMEL_IS_MIME_MESSAGE (content))
+ filename = camel_mime_message_get_subject (CAMEL_MIME_MESSAGE (content));
+ }
+
if (filename != NULL && *filename != '\0') {
gchar *basename = g_path_get_basename (filename);
g_string_append_printf (stext, " (%s)", basename);