aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-backend.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-08-12 20:58:50 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-08-12 23:44:37 +0800
commit6be2668e483cfc7a2e75ae2efcd9675388d08601 (patch)
tree3f0d28830d54da205467bf973eea9895f8003b35 /mail/e-mail-backend.c
parent6456e814fae763ecd9dbdbe4d3caa952ddca0a3d (diff)
downloadgsoc2013-evolution-6be2668e483cfc7a2e75ae2efcd9675388d08601.tar
gsoc2013-evolution-6be2668e483cfc7a2e75ae2efcd9675388d08601.tar.gz
gsoc2013-evolution-6be2668e483cfc7a2e75ae2efcd9675388d08601.tar.bz2
gsoc2013-evolution-6be2668e483cfc7a2e75ae2efcd9675388d08601.tar.lz
gsoc2013-evolution-6be2668e483cfc7a2e75ae2efcd9675388d08601.tar.xz
gsoc2013-evolution-6be2668e483cfc7a2e75ae2efcd9675388d08601.tar.zst
gsoc2013-evolution-6be2668e483cfc7a2e75ae2efcd9675388d08601.zip
Adapt to CamelSession API changes.
These functions now return new references: camel_session_add_service() camel_session_list_services() These functions have been renamed and also return new references: camel_session_get_service() -> camel_session_ref_service() camel_session_get_service_by_url() -> camel_session_ref_service_by_url()
Diffstat (limited to 'mail/e-mail-backend.c')
-rw-r--r--mail/e-mail-backend.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index e706d5571e..e0a0275019 100644
--- a/mail/e-mail-backend.c
+++ b/mail/e-mail-backend.c
@@ -166,18 +166,22 @@ mail_backend_prepare_for_offline_cb (EShell *shell,
const gchar *uid;
uid = e_source_get_uid (source);
- service = camel_session_get_service (
+ service = camel_session_ref_service (
CAMEL_SESSION (session), uid);
- if (!CAMEL_IS_STORE (service))
+ if (service == NULL)
continue;
/* FIXME Not passing a GCancellable. */
- e_mail_store_go_offline (
- CAMEL_STORE (service), G_PRIORITY_DEFAULT,
- NULL, (GAsyncReadyCallback)
- mail_backend_store_operation_done_cb,
- g_object_ref (activity));
+ if (CAMEL_IS_STORE (service))
+ e_mail_store_go_offline (
+ CAMEL_STORE (service),
+ G_PRIORITY_DEFAULT,
+ NULL, (GAsyncReadyCallback)
+ mail_backend_store_operation_done_cb,
+ g_object_ref (activity));
+
+ g_object_unref (service);
}
g_list_free_full (list, (GDestroyNotify) g_object_unref);
@@ -210,18 +214,22 @@ mail_backend_prepare_for_online_cb (EShell *shell,
continue;
uid = e_source_get_uid (source);
- service = camel_session_get_service (
+ service = camel_session_ref_service (
CAMEL_SESSION (session), uid);
- if (!CAMEL_IS_STORE (service))
+ if (service == NULL)
continue;
/* FIXME Not passing a GCancellable. */
- e_mail_store_go_online (
- CAMEL_STORE (service), G_PRIORITY_DEFAULT,
- NULL, (GAsyncReadyCallback)
- mail_backend_store_operation_done_cb,
- g_object_ref (activity));
+ if (CAMEL_IS_STORE (service))
+ e_mail_store_go_online (
+ CAMEL_STORE (service),
+ G_PRIORITY_DEFAULT,
+ NULL, (GAsyncReadyCallback)
+ mail_backend_store_operation_done_cb,
+ g_object_ref (activity));
+
+ g_object_unref (service);
}
g_list_free_full (list, (GDestroyNotify) g_object_unref);
@@ -331,7 +339,7 @@ mail_backend_prepare_for_quit_cb (EShell *shell,
g_object_ref (activity));
}
- g_list_free (list);
+ g_list_free_full (list, (GDestroyNotify) g_object_unref);
/* Now we poll until all activities are actually cancelled or finished.
* Reffing the activity delays quitting; the reference count