g_return_val_if_fail (MODEST_IS_MSG_VIEW_WINDOW (win), NULL);
priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (win);
- selected_attachments = modest_msg_view_get_selected_attachments (MODEST_MSG_VIEW (priv->msg_view));
+ /* In Hildon 2.2 as there's no selection we assume we have all attachments selected */
+ selected_attachments = modest_msg_view_get_attachments (MODEST_MSG_VIEW (priv->msg_view));
return selected_attachments;
}
priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (window);
if (mime_parts == NULL) {
- mime_parts = modest_msg_view_get_selected_attachments (MODEST_MSG_VIEW (priv->msg_view));
+ /* In Hildon 2.2 save and delete operate over all the attachments as there's no
+ * selection available */
+ mime_parts = modest_msg_view_get_attachments (MODEST_MSG_VIEW (priv->msg_view));
if (mime_parts == NULL || tny_list_get_length (mime_parts) == 0)
return;
} else {
g_return_if_fail (MODEST_IS_MSG_VIEW_WINDOW (window));
priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (window);
- if (get_all)
- mime_parts = modest_msg_view_get_attachments (MODEST_MSG_VIEW (priv->msg_view));
- else
- mime_parts = modest_msg_view_get_selected_attachments (MODEST_MSG_VIEW (priv->msg_view));
+ /* In hildon 2.2 we ignore the get_all flag as we always get all attachments. This is
+ * because we don't have selection
+ */
+ mime_parts = modest_msg_view_get_attachments (MODEST_MSG_VIEW (priv->msg_view));
/* Remove already purged messages from mime parts list */
iter = tny_list_create_iterator (mime_parts);
TnyIterator *iter;
iter = tny_list_create_iterator (attachments);
while (!tny_iterator_is_done (iter) && !result) {
+#ifdef MODEST_TOOLKIT_HILDON2
+ gboolean not_selectable = FALSE;
+#endif
TnyMimePart *mime_part = TNY_MIME_PART (tny_iterator_get_current (iter));
TnyList *nested_list = tny_simple_list_new ();
+ tny_mime_part_get_parts (mime_part, nested_list);
if (!for_remove && modest_tny_mime_part_is_msg (mime_part)) {
TnyMsg *window_msg;
window_msg = modest_msg_view_window_get_message (MODEST_MSG_VIEW_WINDOW (win));
if ((TnyMimePart *) window_msg != mime_part) {
selected_messages = TRUE;
+#ifdef MODEST_TOOLKIT_HILDON2
+ not_selectable = TRUE;
+#else
result = TRUE;
+#endif
}
g_object_unref (window_msg);
}
- tny_mime_part_get_parts (mime_part, nested_list);
if (!for_remove && tny_list_get_length (nested_list) > 0) {
nested_attachments = TRUE;
+#ifdef MODEST_TOOLKIT_HILDON2
+ not_selectable = TRUE;
+#else
result = TRUE;
+#endif
}
+#ifdef MODEST_TOOLKIT_HILDON2
+ if (not_selectable)
+ n_selected --;
+#endif
g_object_unref (nested_list);
g_object_unref (mime_part);
tny_iterator_next (iter);
}
g_object_unref (iter);
}
+
+ /* No valid attachment available */
+ if (n_selected == 0)
+ result = TRUE;
/* Set notifications */
if (result && rule != NULL) {