if (msg_is_visible (header, is_outbox)) {
next = gtk_tree_model_get_path (model, &tmp_iter);
*row_reference = gtk_tree_row_reference_new (model, next);
+ gtk_tree_path_free (next);
retval = TRUE;
finished = TRUE;
}
message */
finished = TRUE;
}
+ gtk_tree_path_free (next);
} else {
/* If there are no more messages and we don't
want to start again in the first one then
/* Free */
gtk_tree_path_free (path);
- if (next)
- gtk_tree_path_free (next);
return retval;
}
g_chmod(helper->filepath, 0444);
/* Activate the file */
- modest_platform_activate_file (helper->filepath, tny_mime_part_get_content_type (mime_part));
+ modest_platform_activate_file (helper->filepath, modest_tny_mime_part_get_content_type (mime_part));
free:
/* Frees */
gchar *attachment_uid = NULL;
gint attachment_index = 0;
TnyList *attachments;
+ TnyMimePart *window_msg;
g_return_if_fail (MODEST_IS_MSG_VIEW_WINDOW (window));
g_return_if_fail (TNY_IS_MIME_PART (mime_part) || (mime_part == NULL));
return;
}
- if (!modest_tny_mime_part_is_msg (mime_part)) {
+ /* we also check for mime_part == priv->msg, as this means it's a direct attachment
+ * shown as attachment, so it should behave as a file */
+ window_msg = TNY_MIME_PART (tny_msg_view_get_msg (TNY_MSG_VIEW (priv->msg_view)));
+ if (!modest_tny_mime_part_is_msg (mime_part)||
+ mime_part == window_msg) {
gchar *filepath = NULL;
const gchar *att_filename = tny_mime_part_get_filename (mime_part);
gboolean show_error_banner = FALSE;
const gchar *content_type;
/* the file may already exist but it isn't writable,
* let's try to open it anyway */
- content_type = tny_mime_part_get_content_type (mime_part);
+ content_type = modest_tny_mime_part_get_content_type (mime_part);
modest_platform_activate_file (filepath, content_type);
} else {
g_warning ("%s: modest_utils_create_temp_stream failed", __FUNCTION__);
gtk_widget_show_all (GTK_WIDGET (msg_win));
}
}
+ g_object_unref (window_msg);
g_object_unref (mime_part);
}
gchar *folder = NULL;
gchar *filename = NULL;
gchar *save_multiple_str = NULL;
+ TnyMsg *window_msg;
g_return_if_fail (MODEST_IS_MSG_VIEW_WINDOW (window));
priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (window);
g_object_ref (mime_parts);
}
+ window_msg = tny_msg_view_get_msg (TNY_MSG_VIEW (priv->msg_view));
/* prepare dialog */
if (tny_list_get_length (mime_parts) == 1) {
TnyIterator *iter;
save_multiple_str = g_strdup_printf (_FM("sfil_va_number_of_objects_attachments"),
tny_list_get_length (mime_parts));
}
+ g_object_unref (window_msg);
save_dialog = hildon_file_chooser_dialog_new (GTK_WINDOW (window),
GTK_FILE_CHOOSER_ACTION_SAVE);
return TRUE;;
}
+
+void
+modest_msg_view_window_add_to_contacts (ModestMsgViewWindow *self)
+{
+ modest_ui_actions_on_add_to_contacts (NULL, MODEST_WINDOW (self));
+}
+
+