X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fhildon2%2Fmodest-maemo-utils.c;h=2a1067087b50d33a82f4c9f05fabd5930e414ba9;hb=08da5510e8f59e09cf5f517dc222235c24f5bbf8;hp=efbe29cc352797a9c6706a5917e0d3ec7584f69b;hpb=cc7f0117682ebf3e45c13fa1355eca3251fd3b80;p=modest diff --git a/src/hildon2/modest-maemo-utils.c b/src/hildon2/modest-maemo-utils.c index efbe29c..2a10670 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); @@ -430,7 +437,7 @@ modest_maemo_utils_select_attachments (GtkWindow *window, TnyList *att_list, gbo HILDON_TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE); dialog = hildon_picker_dialog_new (window); - gtk_window_set_title (GTK_WINDOW (dialog), _("mcen_ti_select_attachment_title")); + gtk_window_set_title (GTK_WINDOW (dialog), _("mcen_ti_select_attachments_title")); hildon_picker_dialog_set_selector (HILDON_PICKER_DIALOG (dialog), HILDON_TOUCH_SELECTOR (selector)); hildon_picker_dialog_set_done_label (HILDON_PICKER_DIALOG (dialog), _HL("wdgt_bd_done"));