diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-18 22:34:51 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-05-19 04:07:13 +0800 |
commit | 158128ef783bde14a258429706a94e78b11a06a8 (patch) | |
tree | 8c15c3426b4a319758d0dc0c6cfb38f41eabc7ff /mail/mail-ops.c | |
parent | 2a95b0fc0d8ded03166c77eff0cce597d6a6418c (diff) | |
download | gsoc2013-evolution-158128ef783bde14a258429706a94e78b11a06a8.tar.gz gsoc2013-evolution-158128ef783bde14a258429706a94e78b11a06a8.tar.zst gsoc2013-evolution-158128ef783bde14a258429706a94e78b11a06a8.zip |
Remove mail_get_folderinfo().
Use camel_store_get_folder_info() instead.
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index ad86c772d6..cbb50315ec 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -1031,102 +1031,6 @@ mail_transfer_messages (EMailSession *session, mail_msg_slow_ordered_push (m); } -/* ** SCAN SUBFOLDERS ***************************************************** */ - -struct _get_folderinfo_msg { - MailMsg base; - - CamelStore *store; - CamelFolderInfo *info; - gboolean (*done)(CamelStore *store, CamelFolderInfo *info, gpointer data); - gpointer data; - gboolean can_clear; /* whether we can clear folder info */ -}; - -static gchar * -get_folderinfo_desc (struct _get_folderinfo_msg *m) -{ - gchar *ret, *name; - - name = camel_service_get_name ((CamelService *) m->store, TRUE); - ret = g_strdup_printf (_("Scanning folders in '%s'"), name); - g_free (name); - return ret; -} - -static void -get_folderinfo_exec (struct _get_folderinfo_msg *m, - GCancellable *cancellable, - GError **error) -{ - guint32 flags; - - flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE | - CAMEL_STORE_FOLDER_INFO_FAST | - CAMEL_STORE_FOLDER_INFO_SUBSCRIBED; - - m->info = camel_store_get_folder_info_sync ( - m->store, NULL, flags, - cancellable, error); -} - -static void -get_folderinfo_done (struct _get_folderinfo_msg *m) -{ - if (!m->info && m->base.error != NULL) { - gchar *url; - - url = camel_service_get_url (CAMEL_SERVICE (m->store)); - w(g_warning ("Error getting folder info from store at %s: %s", - url, m->base.error->message)); - g_free (url); - } - - if (m->done) - m->can_clear = m->done (m->store, m->info, m->data); - else - m->can_clear = TRUE; -} - -static void -get_folderinfo_free (struct _get_folderinfo_msg *m) -{ - if (m->info && m->can_clear) - camel_store_free_folder_info (m->store, m->info); - g_object_unref (m->store); -} - -static MailMsgInfo get_folderinfo_info = { - sizeof (struct _get_folderinfo_msg), - (MailMsgDescFunc) get_folderinfo_desc, - (MailMsgExecFunc) get_folderinfo_exec, - (MailMsgDoneFunc) get_folderinfo_done, - (MailMsgFreeFunc) get_folderinfo_free -}; - -gint -mail_get_folderinfo (CamelStore *store, - GCancellable *cancellable, - gboolean (*done)(CamelStore *store, CamelFolderInfo *info, gpointer data), - gpointer data) -{ - struct _get_folderinfo_msg *m; - gint id; - - m = mail_msg_new (&get_folderinfo_info); - if (G_IS_CANCELLABLE (cancellable)) - e_activity_set_cancellable (m->base.activity, cancellable); - m->store = store; - g_object_ref (store); - m->done = done; - m->data = data; - id = m->base.seq; - - mail_msg_unordered_push (m); - - return id; -} - /* ** REMOVE FOLDER ******************************************************* */ struct _remove_folder_msg { |