aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-folder-cache.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-10-23 05:26:08 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-23 05:26:08 +0800
commit2636da7dac1683c7bac98b7a6d1ee084ea2efbca (patch)
tree6263ef3079c3fc885339f46a48cfdea9c35a04ef /mail/mail-folder-cache.c
parenta910a31a06fa3eadb1a44698f0502436bc5db6ce (diff)
downloadgsoc2013-evolution-2636da7dac1683c7bac98b7a6d1ee084ea2efbca.tar.gz
gsoc2013-evolution-2636da7dac1683c7bac98b7a6d1ee084ea2efbca.tar.zst
gsoc2013-evolution-2636da7dac1683c7bac98b7a6d1ee084ea2efbca.zip
Kill mail_store_set_offline().
Replace it with new async functions: e_mail_store_go_offline() e_mail_store_go_offline_finish() e_mail_store_go_online() e_mail_store_go_online_finish()
Diffstat (limited to 'mail/mail-folder-cache.c')
-rw-r--r--mail/mail-folder-cache.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 8b19da4879..8b3f3d2c24 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -52,6 +52,7 @@
#include "em-utils.h"
#include "e-mail-local.h"
#include "e-mail-session.h"
+#include "e-mail-store-utils.h"
#define w(x)
#define d(x)
@@ -856,9 +857,11 @@ ping_cb (MailFolderCache *self)
}
static void
-store_online_cb (CamelStore *store, gpointer data)
+store_go_online_cb (CamelStore *store,
+ GAsyncResult *result,
+ struct _update_data *ud)
{
- struct _update_data *ud = data;
+ /* FIXME Not checking result for error. */
g_mutex_lock (ud->cache->priv->stores_mutex);
@@ -1101,10 +1104,8 @@ mail_folder_cache_note_store (MailFolderCache *self,
si = g_malloc0 (sizeof (*si));
si->folders = g_hash_table_new (g_str_hash, g_str_equal);
si->folders_uri = g_hash_table_new (
- CAMEL_STORE_CLASS (
- CAMEL_OBJECT_GET_CLASS (store))->hash_folder_name,
- CAMEL_STORE_CLASS (
- CAMEL_OBJECT_GET_CLASS (store))->compare_folder_name);
+ CAMEL_STORE_GET_CLASS (store)->hash_folder_name,
+ CAMEL_STORE_GET_CLASS (store)->compare_folder_name);
si->store = g_object_ref (store);
g_hash_table_insert (self->priv->stores, store, si);
g_queue_init (&si->folderinfo_updates);
@@ -1124,8 +1125,9 @@ mail_folder_cache_note_store (MailFolderCache *self,
if (camel_session_get_online (session) &&
camel_disco_store_status (CAMEL_DISCO_STORE (store)) ==
CAMEL_DISCO_STORE_OFFLINE) {
- /* Note: we use the 'id' here, even though its not the right id, its still ok */
- ud->id = mail_store_set_offline (store, FALSE, store_online_cb, ud);
+ e_mail_store_go_online (
+ store, G_PRIORITY_DEFAULT, cancellable,
+ (GAsyncReadyCallback) store_go_online_cb, ud);
} else {
goto normal_setup;
}
@@ -1133,8 +1135,9 @@ mail_folder_cache_note_store (MailFolderCache *self,
if (camel_session_get_online (session) &&
!camel_offline_store_get_online (
CAMEL_OFFLINE_STORE (store))) {
- /* Note: we use the 'id' here, even though its not the right id, its still ok */
- ud->id = mail_store_set_offline (store, FALSE, store_online_cb, ud);
+ e_mail_store_go_online (
+ store, G_PRIORITY_DEFAULT, cancellable,
+ (GAsyncReadyCallback) store_go_online_cb, ud);
} else {
goto normal_setup;
}