From b6a6134ec1da8ab60641a6dabb515561521ea23e Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Thu, 12 Mar 2009 09:41:37 +0000 Subject: [PATCH] * Embedded messages without a filename shows their subject in save/remove attachments dialogs * This with the previous commits: * Fixes NB#102852, allow to remove embedded msgs as attachments * Fixes NB#105412, list embedded msgs in select attachment dialog to remove them pmo-trunk-r7971 --- src/hildon2/modest-maemo-utils.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/hildon2/modest-maemo-utils.c b/src/hildon2/modest-maemo-utils.c index efbe29c..0ef4d77 100644 --- a/src/hildon2/modest-maemo-utils.c +++ b/src/hildon2/modest-maemo-utils.c @@ -404,16 +404,23 @@ modest_maemo_utils_select_attachments (GtkWindow *window, TnyList *att_list, gbo tny_iterator_next (iterator)) { GtkTreeIter iter; TnyMimePart *part; + gchar *label; + gchar *filename = NULL; part = (TnyMimePart *) tny_iterator_get_current (iterator); - /* Embbeded messages are not offered to be - saved. Purged attachments are ignored as well */ - if (!TNY_IS_MSG (part) && !tny_mime_part_is_purged (part)) { - gchar *label; - gchar *filename = NULL; - - filename = g_strdup (tny_mime_part_get_filename (part)); + /* Ignore purged attachments and messages if ignore is + set to TRUE */ + if (!(tny_mime_part_is_purged (part) || + (TNY_IS_MSG (part) && !include_msgs))) { + + if (TNY_IS_MSG (part)) { + TnyHeader *header = tny_msg_get_header (TNY_MSG (part)); + filename = tny_header_dup_subject (header); + g_object_unref (header); + } else { + filename = g_strdup (tny_mime_part_get_filename (part)); + } label = g_strconcat (filename, NULL); gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, label, 1, part, -1); -- 1.7.9.5