[evolution-data-server/gnome-3-8] CamelDiscoStore: Fix CamelServiceConnectionStatus tracking.



commit 0cb406114e8071493e40a702ebef8e446a3966c6
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Aug 6 08:34:23 2013 +0200

    CamelDiscoStore: Fix CamelServiceConnectionStatus tracking.
    
    Do not set CAMEL_DISCO_STORE_OFFLINE when the CamelService reports
    something other than CAMEL_SERVICE_CONNECTED.  That would lock the
    store into offline mode such that further connection attempts will
    simply invoke connect_offline() and never actually establish a new
    server connection.
    
    (cherry picked from commit dde0172ca1398e6702f148807a24f9abbd2021ff)

 camel/camel-disco-store.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/camel/camel-disco-store.c b/camel/camel-disco-store.c
index 6cc7110..161da53 100644
--- a/camel/camel-disco-store.c
+++ b/camel/camel-disco-store.c
@@ -44,15 +44,19 @@ static void
 disco_store_update_status (CamelDiscoStore *disco)
 {
        CamelService *service = CAMEL_SERVICE (disco);
+       CamelServiceConnectionStatus status;
 
-       switch (camel_service_get_connection_status (service)) {
-               case CAMEL_SERVICE_CONNECTED:
-                       disco->status = CAMEL_DISCO_STORE_ONLINE;
-                       break;
-               default:
-                       disco->status = CAMEL_DISCO_STORE_OFFLINE;
-                       break;
-       }
+       status = camel_service_get_connection_status (service);
+
+       /* Do not set CAMEL_DISCO_STORE_OFFLINE when the CamelService reports
+        * something other than CAMEL_SERVICE_CONNECTED.  That would lock the
+        * store into offline mode such that further connection attempts will
+        * simply invoke connect_offline() and never actually establish a new
+        * server connection. */
+       if (status == CAMEL_SERVICE_CONNECTED)
+               disco->status = CAMEL_DISCO_STORE_ONLINE;
+
+       g_object_notify (G_OBJECT (disco), "online");
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]