diff options
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 0678370b49..1438805321 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -1894,87 +1894,6 @@ mail_save_messages (CamelFolder *folder, GPtrArray *uids, const gchar *path, return id; } -/* ** Prepare OFFLINE ***************************************************** */ - -struct _set_offline_msg { - MailMsg base; - - CamelStore *store; - gboolean offline; - void (*done)(CamelStore *store, gpointer data); - gpointer data; -}; - -static gchar * -prepare_offline_desc (struct _set_offline_msg *m) -{ - gchar *service_name = camel_service_get_name (CAMEL_SERVICE (m->store), TRUE); - gchar *msg; - - msg = g_strdup_printf (_("Preparing account '%s' for offline"), service_name); - g_free (service_name); - - return msg; -} - -static void -prepare_offline_exec (struct _set_offline_msg *m, - GCancellable *cancellable, - GError **error) -{ - if (CAMEL_IS_DISCO_STORE (m->store)) { - camel_disco_store_prepare_for_offline ( - CAMEL_DISCO_STORE (m->store), - cancellable, error); - } else if (CAMEL_IS_OFFLINE_STORE (m->store)) { - camel_offline_store_prepare_for_offline_sync ( - CAMEL_OFFLINE_STORE (m->store), - cancellable, error); - } -} - -static void -prepare_offline_done (struct _set_offline_msg *m) -{ - if (m->done) - m->done (m->store, m->data); -} - -static void -prepare_offline_free (struct _set_offline_msg *m) -{ - g_object_unref (m->store); -} - -static MailMsgInfo prepare_offline_info = { - sizeof (struct _set_offline_msg), - (MailMsgDescFunc) prepare_offline_desc, - (MailMsgExecFunc) prepare_offline_exec, - (MailMsgDoneFunc) prepare_offline_done, - (MailMsgFreeFunc) prepare_offline_free -}; - -gint -mail_store_prepare_offline (CamelStore *store) -{ - struct _set_offline_msg *m; - gint id; - - /* Cancel any pending connect first so the set_offline_op - * thread won't get queued behind a hung connect op. - */ - - m = mail_msg_new (&prepare_offline_info); - m->store = store; - g_object_ref (store); - m->data = NULL; - m->done = NULL; - - id = m->base.seq; - mail_msg_unordered_push (m); - - return id; -} /* ** Execute Shell Command ***************************************************** */ void |