X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fhildon2%2Fmodest-maemo-utils.c;h=2a1067087b50d33a82f4c9f05fabd5930e414ba9;hb=08da5510e8f59e09cf5f517dc222235c24f5bbf8;hp=b8078f47c787a33b53aa2b86443d2cc636005e4f;hpb=cca502af5db5549021fdf2aca1a57a8333a07fac;p=modest diff --git a/src/hildon2/modest-maemo-utils.c b/src/hildon2/modest-maemo-utils.c index b8078f4..2a10670 100644 --- a/src/hildon2/modest-maemo-utils.c +++ b/src/hildon2/modest-maemo-utils.c @@ -388,7 +388,7 @@ static gboolean match_all (TnyList *list, GObject *item, gpointer match_data) } gboolean -modest_maemo_utils_select_attachments (GtkWindow *window, TnyList *att_list) +modest_maemo_utils_select_attachments (GtkWindow *window, TnyList *att_list, gboolean include_msgs) { GtkTreeModel *model; TnyIterator *iterator; @@ -404,16 +404,23 @@ modest_maemo_utils_select_attachments (GtkWindow *window, TnyList *att_list) 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) 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"));