aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-09-30 20:16:30 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-01 01:55:38 +0800
commit75b078e99793350fa2f54ca80b72213d1bfbb17f (patch)
tree1327ffa3b9e87538e6302aeff6f64e28e6935d98 /mail/mail-ops.c
parentdb5afff530e35d643f23b8d4e35c930e26e58804 (diff)
downloadgsoc2013-evolution-75b078e99793350fa2f54ca80b72213d1bfbb17f.tar.gz
gsoc2013-evolution-75b078e99793350fa2f54ca80b72213d1bfbb17f.tar.zst
gsoc2013-evolution-75b078e99793350fa2f54ca80b72213d1bfbb17f.zip
Kill em_utils_temp_save_part().
Rewrite the last usage of it in itip-formatter.c to use EAttachments instead. This also allowed me to kill mail_save_part() in mail-ops.c. I may need to reevaluate the EAttachment API at some point for all these fringe EAttachment uses we're accumulating. Having to asynchronously "load" an EAttachment whose content is already in memory kinda sucks.
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c107
1 files changed, 0 insertions, 107 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 1146f8d126..4fd6ab207e 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -2303,113 +2303,6 @@ mail_save_messages (CamelFolder *folder, GPtrArray *uids, const gchar *path,
return id;
}
-/* ** SAVE PART ******************************************************* */
-
-struct _save_part_msg {
- MailMsg base;
-
- CamelMimePart *part;
- gchar *path;
- void (*done)(CamelMimePart *part, gchar *path, gint saved, gpointer data);
- gpointer data;
- gboolean readonly;
-};
-
-static gchar *
-save_part_desc (struct _save_part_msg *m)
-{
- return g_strdup(_("Saving attachment"));
-}
-
-static void
-save_part_exec (struct _save_part_msg *m)
-{
- CamelDataWrapper *content;
- CamelStream *stream;
- gchar *path;
-
- if (strstr (m->path, "://"))
- path = m->path;
- else
- path = g_filename_to_uri (m->path, NULL, NULL);
-
- if (!m->readonly) {
- if (!(stream = camel_stream_vfs_new_with_uri (path, CAMEL_STREAM_VFS_CREATE))) {
- g_set_error (
- &m->base.error, G_FILE_ERROR,
- g_file_error_from_errno (errno),
- _("Cannot create output file: %s:\n %s"),
- path, g_strerror (errno));
- if (path != m->path)
- g_free (path);
- return;
- }
- } else if (!(stream = camel_stream_vfs_new_with_uri (path, CAMEL_STREAM_VFS_CREATE))) {
- g_set_error (
- &m->base.error, G_FILE_ERROR,
- g_file_error_from_errno (errno),
- _("Cannot create output file: %s:\n %s"),
- path, g_strerror (errno));
- if (path != m->path)
- g_free (path);
- return;
- }
-
- if (path != m->path)
- g_free (path);
-
- content = camel_medium_get_content (CAMEL_MEDIUM (m->part));
-
- if (camel_data_wrapper_decode_to_stream_sync (
- content, stream, m->base.cancellable, &m->base.error) == -1
- || camel_stream_flush (stream, m->base.cancellable, &m->base.error) == -1)
- g_prefix_error (&m->base.error, _("Could not write data: "));
-
- g_object_unref (stream);
-}
-
-static void
-save_part_done (struct _save_part_msg *m)
-{
- if (m->done)
- m->done (m->part, m->path, m->base.error == NULL, m->data);
-}
-
-static void
-save_part_free (struct _save_part_msg *m)
-{
- g_object_unref (m->part);
- g_free (m->path);
-}
-
-static MailMsgInfo save_part_info = {
- sizeof (struct _save_part_msg),
- (MailMsgDescFunc) save_part_desc,
- (MailMsgExecFunc) save_part_exec,
- (MailMsgDoneFunc) save_part_done,
- (MailMsgFreeFunc) save_part_free
-};
-
-gint
-mail_save_part (CamelMimePart *part, const gchar *path,
- void (*done)(CamelMimePart *part, gchar *path, gint saved, gpointer data), gpointer data, gboolean readonly)
-{
- struct _save_part_msg *m;
- gint id;
- m = mail_msg_new (&save_part_info);
- m->part = part;
- g_object_ref (part);
- m->path = g_strdup (path);
- m->data = data;
- m->done = done;
- m->readonly = readonly;
-
- id = m->base.seq;
- mail_msg_unordered_push (m);
-
- return id;
-}
-
/* ** PREPARE OFFLINE ***************************************************** */
struct _prep_offline_msg {