aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-03-10 18:43:25 +0800
committerMilan Crha <mcrha@redhat.com>2011-03-10 18:43:25 +0800
commit8b0f78bb9c5ab6f3903b99a62704c3bb2a018467 (patch)
tree3e1e1a2dd544c3ea2dd62f7cf4b326e985ce9016
parenteef2191a3a4fc8bb358b04a1eb0c10ba5f34e611 (diff)
downloadgsoc2013-evolution-8b0f78bb9c5ab6f3903b99a62704c3bb2a018467.tar.gz
gsoc2013-evolution-8b0f78bb9c5ab6f3903b99a62704c3bb2a018467.tar.zst
gsoc2013-evolution-8b0f78bb9c5ab6f3903b99a62704c3bb2a018467.zip
Use message subject for attachment description if no filename provided
-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);