tny_iterator_next (iter);
}
+ g_object_unref (iter);
+
if (pending_purges>0) {
gint response;
if (response == GTK_RESPONSE_OK) {
modest_platform_information_banner (NULL, NULL, _("mcen_ib_removing_attachment"));
- tny_iterator_first (iter);
+ iter = tny_list_create_iterator (parts);
while (!tny_iterator_is_done (iter)) {
TnyMimePart *part;
} else {
modest_platform_information_banner (NULL, NULL, _("mail_ib_attachment_already_purged"));
}
+ g_object_unref (iter);
- /* remove attachments */
- tny_iterator_first (iter);
- while (!tny_iterator_is_done (iter)) {
- TnyMimePart *part;
-
- part = TNY_MIME_PART (tny_iterator_get_current (iter));
- if (part) {
- /* One for the reference given by tny_iterator_get_current(): */
- g_object_unref (part);
-
- /* TODO: Is this meant to remove the attachment by doing another unref()?
- * Otherwise, this seems useless. */
- }
-
- tny_iterator_next (iter);
- }
modest_window_mgr_unregister_header (mgr, header);
- g_object_unref (iter);
g_object_unref (parts);
}
all_has_attach = all_has_attach && (flags & TNY_HEADER_FLAG_ATTACHMENTS);
state->all_has_attachments = all_has_attach;
if (!state->any_has_attachments)
- state->any_has_attachments = flags & TNY_HEADER_FLAG_ATTACHMENTS;
+ state->any_has_attachments = (flags & TNY_HEADER_FLAG_ATTACHMENTS)?1:0;
/* sent in progress */
msg_uid = modest_tny_send_queue_get_msg_id (header);
/* Check if the selected message in main window has attachments */
if (!dimmed && MODEST_IS_MAIN_WINDOW (win)) {
- dimmed = state->any_has_attachments;
+ dimmed = !(state->any_has_attachments);
if (dimmed)
modest_dimming_rule_set_notification (rule, _("mail_ib_unable_to_purge_attachments"));
}