* src/modest-ui-dimming-rules.c:
authorJose Dapena Paz <jdapena@igalia.com>
Thu, 28 Feb 2008 20:54:33 +0000 (20:54 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Thu, 28 Feb 2008 20:54:33 +0000 (20:54 +0000)
        * 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
src/widgets/modest-attachment-view.c

index c5ec36b..a422bb8 100644 (file)
@@ -38,6 +38,7 @@
 #include "modest-debug.h"
 #include "modest-tny-folder.h"
 #include "modest-tny-account.h"
 #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 <widgets/modest-attachments-view.h>
 #include <modest-runtime.h>
 #include "modest-text-utils.h"
 #include <widgets/modest-attachments-view.h>
 #include <modest-runtime.h>
@@ -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 ();
                        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;
                                }
                                        selected_messages = TRUE;
                                        result = TRUE;
                                }
index 38a2146..3d724ac 100644 (file)
@@ -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)) {
        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)
                        if (filename == NULL || filename[0] == '\0')
                                filename = g_strdup (_("mail_va_no_subject"));
                        if (priv->is_purged)