From: Sergio Villar Senin Date: Mon, 23 Feb 2009 16:08:48 +0000 (+0000) Subject: * Fixes NB#102852, dim remove attachments if we only have embedded messages as attach... X-Git-Tag: git_migration_finished~501 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=fa63d28f116f3b6b735e126dfa796976ef3f490a * Fixes NB#102852, dim remove attachments if we only have embedded messages as attachments pmo-trunk-r7644 --- diff --git a/src/modest-ui-dimming-rules.c b/src/modest-ui-dimming-rules.c index 9dc1b4f..4132b44 100644 --- a/src/modest-ui-dimming-rules.c +++ b/src/modest-ui-dimming-rules.c @@ -1397,29 +1397,26 @@ modest_ui_dimming_rules_on_remove_attachments (ModestWindow *win, gpointer user_ dimmed = _invalid_attach_selected (win, FALSE, FALSE, TRUE, NULL); if (dimmed) modest_dimming_rule_set_notification (rule, _("FIXME:no attachment selected")); - } -#ifndef MODEST_TOOLKIT_HILDON2 - /* Messages as attachments could not be removed */ - if (!dimmed && MODEST_IS_MSG_VIEW_WINDOW (win)) { - TnyList *attachments; - TnyIterator *iter; - attachments = modest_msg_view_window_get_attachments (MODEST_MSG_VIEW_WINDOW (win)); - if (attachments) { - iter = tny_list_create_iterator (attachments); - while (!tny_iterator_is_done (iter) && !dimmed) { - TnyMimePart *mime_part = (TnyMimePart *) - tny_iterator_get_current (iter); - if (modest_tny_mime_part_is_msg (mime_part)) - dimmed = TRUE; - g_object_unref (mime_part); - tny_iterator_next (iter); + if (!dimmed) { + TnyList *attachments; + TnyIterator *iter; + attachments = modest_msg_view_window_get_attachments (MODEST_MSG_VIEW_WINDOW (win)); + if (attachments) { + iter = tny_list_create_iterator (attachments); + while (!tny_iterator_is_done (iter) && !dimmed) { + TnyMimePart *mime_part = (TnyMimePart *) + tny_iterator_get_current (iter); + if (modest_tny_mime_part_is_msg (mime_part)) + dimmed = TRUE; + g_object_unref (mime_part); + tny_iterator_next (iter); + } + g_object_unref (iter); + g_object_unref (attachments); } - g_object_unref (iter); - g_object_unref (attachments); } } -#endif if (!dimmed) {