Index: calendar/ChangeLog
===================================================================
--- calendar/ChangeLog	(revision 9610)
+++ calendar/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2008-09-26  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.
+
 2008-09-24  Ross Burton  <ross@linux.intel.com>
 
 	* libecal/libecal.pc.in:
Index: calendar/libecal/e-cal.c
===================================================================
--- calendar/libecal/e-cal.c	(revision 9610)
+++ calendar/libecal/e-cal.c	(working copy)
@@ -948,6 +948,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));
 }
 
