[evolution-data-server] Ask calendar on a readonly state after changing its mode



commit 9279e6a47bc90012e1400e0d460b0c94919f79da
Author: Milan Crha <mcrha redhat com>
Date:   Tue Apr 28 13:50:54 2009 +0200

    Ask calendar on a readonly state after changing its mode
    
    	** Part of fix for bug #553932
    
    	* libecal/e-cal.c: (cal_set_mode_cb): Recheck readonly state for
    	loaded ECal-s when changing online/offline mode.
---
 calendar/ChangeLog       |    7 +++++++
 calendar/libecal/e-cal.c |   15 +++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 6a3d548..5147b8c 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-28  Milan Crha  <mcrha redhat com>
+
+	** Part of fix for bug #553932
+
+	* libecal/e-cal.c: (cal_set_mode_cb): Recheck readonly state for
+	loaded ECal-s when changing online/offline mode.
+
 2009-04-27  Milan Crha  <mcrha redhat com>
 
 	** Part of fix for bug #575773
diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index 9603a52..9612e13 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -951,6 +951,21 @@ cal_set_mode_cb (ECalListener *listener,
 	g_signal_emit (G_OBJECT (ecal), e_cal_signals[CAL_SET_MODE],
 		       0, ecal_status, mode);
 
+	if (ecal_status == E_CAL_SET_MODE_SUCCESS && ecal->priv->load_state == E_CAL_LOAD_LOADED) {
+		/* the mode has been changed, recheck whether readonly or not */
+		GError *error = NULL;
+		gboolean read_only = TRUE;
+
+		if (get_read_only (ecal, &read_only, &error)) {
+			priv->read_only = read_only;
+		}
+
+		if (error) {
+			g_warning ("%s: get_read_only failed: %s", G_STRFUNC, error->message);
+			g_error_free (error);
+		}
+	}
+
 	g_object_unref (G_OBJECT (ecal));
 }
 



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