[evolution] Bug #702709 - Do not forget to set CamelSession offline
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug #702709 - Do not forget to set CamelSession offline
- Date: Tue, 21 Jan 2014 11:53:22 +0000 (UTC)
commit a9730b3e4a557deaec422f3c191418e7a66184e7
Author: Milan Crha <mcrha redhat com>
Date: Tue Jan 21 12:51:50 2014 +0100
Bug #702709 - Do not forget to set CamelSession offline
There was missing a call to set CamelSession offline, which made
the other CamelService-s think they can do network operations,
while it wasn't true.
mail/e-mail-backend.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index dbbd25e..3e89447 100644
--- a/mail/e-mail-backend.c
+++ b/mail/e-mail-backend.c
@@ -123,6 +123,18 @@ mail_backend_store_operation_done_cb (CamelStore *store,
}
static void
+mail_backend_set_session_offline_cb (gpointer user_data,
+ GObject *object)
+{
+ CamelSession *session = user_data;
+
+ g_return_if_fail (CAMEL_IS_SESSION (session));
+
+ camel_session_set_online (session, FALSE);
+ g_object_unref (session);
+}
+
+static void
mail_backend_prepare_for_offline_cb (EShell *shell,
EActivity *activity,
EMailBackend *backend)
@@ -139,6 +151,9 @@ mail_backend_prepare_for_offline_cb (EShell *shell,
session = e_mail_backend_get_session (backend);
account_store = e_mail_ui_session_get_account_store (E_MAIL_UI_SESSION (session));
+ if (!e_shell_get_network_available (shell))
+ camel_session_set_online (CAMEL_SESSION (session), FALSE);
+
if (e_shell_backend_is_started (shell_backend)) {
gboolean synchronize = FALSE;
@@ -160,6 +175,8 @@ mail_backend_prepare_for_offline_cb (EShell *shell,
e_shell_backend_add_activity (shell_backend, activity);
}
+ g_object_weak_ref (G_OBJECT (activity), mail_backend_set_session_offline_cb, g_object_ref (session));
+
e_mail_account_store_queue_enabled_services (account_store, &queue);
while (!g_queue_is_empty (&queue)) {
CamelService *service;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]