+#else
+ /* In gtk we get only selected attachments for the operation.
+ */
+ mime_parts = modest_msg_view_get_selected_attachments (MODEST_MSG_VIEW (priv->msg_view));
+
+ /* Remove already purged messages from mime parts list. We use
+ a copy of the list to remove items in the original one */
+ tmp = tny_list_copy (mime_parts);
+ iter = tny_list_create_iterator (tmp);
+ while (!tny_iterator_is_done (iter)) {
+ TnyMimePart *part = TNY_MIME_PART (tny_iterator_get_current (iter));
+ if (tny_mime_part_is_purged (part))
+ tny_list_remove (mime_parts, (GObject *) part);
+
+ g_object_unref (part);
+ tny_iterator_next (iter);
+ }
+ g_object_unref (tmp);
+ g_object_unref (iter);
+
+ if (tny_list_get_length (mime_parts) == 0) {
+ g_object_unref (mime_parts);
+ return;
+ }
+#endif