[evolution-kolab/ek-wip-porting] ECalBackendKolab: added backend removal notification



commit 32bbd3d53b92bc705f4a8cbe8ce49351013b3637
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Sun Mar 18 18:05:05 2012 +0100

    ECalBackendKolab: added backend removal notification
    
    * notify E-D-S when the backend is removed

 src/calendar/e-cal-backend-kolab.c |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-kolab.c b/src/calendar/e-cal-backend-kolab.c
index 0d3cb30..61e8edb 100644
--- a/src/calendar/e-cal-backend-kolab.c
+++ b/src/calendar/e-cal-backend-kolab.c
@@ -166,7 +166,7 @@ cal_backend_kolab_signal_online_cb (GObject *object)
 }
 
 static gboolean
-cal_backend_kolab_notify_open (ECalBackendKolab *self,
+cal_backend_kolab_notify_opened (ECalBackendKolab *self,
                                GError **err)
 {
 	ECalBackend *cbackend = NULL;
@@ -187,11 +187,25 @@ cal_backend_kolab_notify_open (ECalBackendKolab *self,
 	}
 	e_cal_backend_notify_online (cbackend,
 	                             tmp_mode = KOLAB_MAIL_ACCESS_OPMODE_ONLINE ? TRUE : FALSE);
+	e_cal_backend_notify_readonly (cbackend, FALSE);
 	e_cal_backend_notify_opened (cbackend, NULL);
 
 	return TRUE;
 }
 
+static void
+cal_backend_kolab_notify_removed (ECalBackendKolab *self)
+{
+	ECalBackend *cbackend = NULL;
+
+	g_assert (E_IS_CAL_BACKEND_KOLAB (self));
+
+	cbackend = E_CAL_BACKEND (self);
+
+	e_cal_backend_notify_readonly (cbackend, TRUE);
+	e_cal_backend_notify_online (cbackend, FALSE);
+}
+
 /*----------------------------------------------------------------------------*/
 /* class functions */
 
@@ -362,7 +376,7 @@ e_cal_backend_kolab_open (ECalBackendSync *backend,
 			g_error_free (tmp_err);
 			return;
 		}
-		ok = cal_backend_kolab_notify_open (self, &tmp_err);
+		ok = cal_backend_kolab_notify_opened (self, &tmp_err);
 		if (! ok) {
 			kolab_util_calendar_err_to_edb_err (error, tmp_err, __func__, __LINE__);
 			g_error_free (tmp_err);
@@ -486,9 +500,9 @@ e_cal_backend_kolab_remove (ECalBackendSync *backend,
 		g_object_unref (priv->cal_cache);
 		priv->cal_cache = NULL;
 	}
-
-	return GNOME_Evolution_Calendar_Success;
 #endif
+
+	cal_backend_kolab_notify_removed (self);
 }
 
 static void
@@ -1695,7 +1709,7 @@ e_cal_backend_kolab_authenticate_user (ECalBackendSync *backend,
 		return;
 	}
 
-	ok = cal_backend_kolab_notify_open (self, &tmp_err);
+	ok = cal_backend_kolab_notify_opened (self, &tmp_err);
 	if (! ok) {
 		kolab_util_calendar_err_to_edb_err (error, tmp_err, __func__, __LINE__);
 		g_error_free (tmp_err);



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