[evolution-data-server] CamelDiscoStore: Fix CamelServiceConnectionStatus tracking.



commit dde0172ca1398e6702f148807a24f9abbd2021ff
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.

 camel/camel-disco-store.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/camel/camel-disco-store.c b/camel/camel-disco-store.c
index 349eb7b..ffc3472 100644
--- a/camel/camel-disco-store.c
+++ b/camel/camel-disco-store.c
@@ -49,15 +49,17 @@ 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");
 }


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