From 1cb8d01ea12aa1a9d17a25f7b57cd57f88d22f31 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Thu, 28 Feb 2008 20:54:33 +0000 Subject: [PATCH 1/1] * src/modest-ui-dimming-rules.c: * Now we use the custom modest method to know if a mime part is an attached message (as it was failing for "file as message" attachments). * src/widgets/modest-attachment-view.c: * Now we show the filename of the attachment even if it's a TnyMsg. This makes "file as message" attachments show the proper name (fixes NB#81527). pmo-trunk-r4253 --- src/modest-ui-dimming-rules.c | 3 ++- src/widgets/modest-attachment-view.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modest-ui-dimming-rules.c b/src/modest-ui-dimming-rules.c index c5ec36b..a422bb8 100644 --- a/src/modest-ui-dimming-rules.c +++ b/src/modest-ui-dimming-rules.c @@ -38,6 +38,7 @@ #include "modest-debug.h" #include "modest-tny-folder.h" #include "modest-tny-account.h" +#include "modest-tny-mime-part.h" #include "modest-text-utils.h" #include #include @@ -2401,7 +2402,7 @@ _invalid_attach_selected (ModestWindow *win, while (!tny_iterator_is_done (iter) && !result) { TnyMimePart *mime_part = TNY_MIME_PART (tny_iterator_get_current (iter)); TnyList *nested_list = tny_simple_list_new (); - if (!for_remove && TNY_IS_MSG (mime_part)) { + if (!for_remove && modest_tny_mime_part_is_msg (mime_part)) { selected_messages = TRUE; result = TRUE; } diff --git a/src/widgets/modest-attachment-view.c b/src/widgets/modest-attachment-view.c index 38a2146..3d724ac 100644 --- a/src/widgets/modest-attachment-view.c +++ b/src/widgets/modest-attachment-view.c @@ -247,7 +247,9 @@ modest_attachment_view_set_part_default (TnyMimePartView *self, TnyMimePart *mim if (TNY_IS_MSG (mime_part)) { TnyHeader *header = tny_msg_get_header (TNY_MSG (mime_part)); if (TNY_IS_HEADER (header)) { - filename = g_strdup (tny_header_get_subject (header)); + filename = g_strdup (tny_mime_part_get_filename (mime_part)); + if (!filename) + filename = g_strdup (tny_header_get_subject (header)); if (filename == NULL || filename[0] == '\0') filename = g_strdup (_("mail_va_no_subject")); if (priv->is_purged) -- 1.7.9.5