diff options
Diffstat (limited to 'mail/em-utils.c')
-rw-r--r-- | mail/em-utils.c | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/mail/em-utils.c b/mail/em-utils.c index 4f264955bd..ee547c4372 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -343,82 +343,6 @@ em_filename_make_safe (gchar *string) } } -/* Saving messages... */ - -struct _save_messages_data { - CamelFolder *folder; - GPtrArray *uids; -}; - -static void -emu_save_messages_response(GtkWidget *filesel, gint response, struct _save_messages_data *data) -{ - gchar *uri; - - if (response == GTK_RESPONSE_OK) { - uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (filesel)); - - if (!e_file_can_save((GtkWindow *)filesel, uri)) { - g_free(uri); - return; - } - - e_file_update_save_path(gtk_file_chooser_get_current_folder_uri( - GTK_FILE_CHOOSER (filesel)), TRUE); - mail_save_messages(data->folder, data->uids, uri, NULL, NULL); - data->uids = NULL; - g_free(uri); - } - - camel_object_unref(data->folder); - if (data->uids) - em_utils_uids_free(data->uids); - g_free(data); - gtk_widget_destroy((GtkWidget *)filesel); -} - -/** - * em_utils_save_messages: - * @parent: parent window - * @folder: folder containing messages to save - * @uids: uids of messages to save - * - * Saves a group of messages to disk in mbox format (prompting the - * user for filename). - **/ -void -em_utils_save_messages (GtkWindow *parent, CamelFolder *folder, GPtrArray *uids) -{ - struct _save_messages_data *data; - GtkWidget *filesel; - gchar *filename = NULL; - CamelMessageInfo *info = NULL; - - g_return_if_fail (GTK_IS_WINDOW (parent)); - g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (uids != NULL); - - info = camel_folder_get_message_info (folder, uids->pdata[0]); - if (info) { - filename = g_strdup (camel_message_info_subject (info)); - e_filename_make_safe (filename); - camel_message_info_free (info); - } - - filesel = e_file_get_save_filesel (parent, _("Save Message..."), filename, GTK_FILE_CHOOSER_ACTION_SAVE); - if (filename) - g_free (filename); - - camel_object_ref(folder); - - data = g_malloc(sizeof(struct _save_messages_data)); - data->folder = folder; - data->uids = uids; - - g_signal_connect(filesel, "response", G_CALLBACK(emu_save_messages_response), data); - gtk_widget_show((GtkWidget *)filesel); -} - /* ********************************************************************** */ /* Flag-for-Followup... */ |