[evolution-patches] fix for 3088802 EDS changes [calendar]



Hi,
   Missed to send the EDS changes. Since we set the default time zone
before calendar loading, modified the backend code to put the
default_zone while opening the calendar.


thanks, Chenthill.
? .eds.diff.swp
? 116162.diff
? 266144_eds.diff
? 309674.diff
? 311831.diff
? 312578.diff
? 312853.diff
? all_day.diff
? config.guess
? config.sub
? depcomp
? eds.diff
? freebusy.diff
? install-sh
? ltmain.sh
? missing
? mkinstalldirs
? recur
? recur_fix
? recurrence_eds.diff
? remove_patch
? temp
? ylwrap
? backends/groupwise/e-cal-backend-groupwise.c_bak
? backends/groupwise/temp
? libecal/.e-cal-marshal.c.swp
? libecal/.e-cal.c.swo
? libecal/e-cal.c_210
? libecal/e-cal.c_bak
? libedata-cal/.e-cal-backend.h.swp
? libedata-cal/.e-data-cal-factory.c.swo
? libical/src/libical/.icalproperty.c.swp
? tests/ecal/test-recur
Index: backends/contacts/e-cal-backend-contacts.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/contacts/e-cal-backend-contacts.c,v
retrieving revision 1.26
diff -u -p -r1.26 e-cal-backend-contacts.c
--- backends/contacts/e-cal-backend-contacts.c	11 Oct 2005 07:56:18 -0000	1.26
+++ backends/contacts/e-cal-backend-contacts.c	20 Oct 2005 12:15:07 -0000
@@ -79,6 +79,8 @@ static ECalComponent * create_anniversar
 static void contacts_changed_cb (EBookView *book_view, const GList *contacts, gpointer user_data);
 static void contacts_added_cb   (EBookView *book_view, const GList *contacts, gpointer user_data);
 static void contacts_removed_cb (EBookView *book_view, const GList *contact_ids, gpointer user_data);
+static ECalBackendSyncStatus
+e_cal_backend_contacts_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj);
 
 /* BookRecord methods */
 static BookRecord *
@@ -731,7 +733,9 @@ e_cal_backend_contacts_open (ECalBackend
         if (priv->addressbook_loaded)
                 return GNOME_Evolution_Calendar_Success;
 
-        /* Create address books for existing sources */
+        e_cal_backend_contacts_add_timezone (backend, cal, (const char *) icaltimezone_get_tzid (priv->default_zone));
+
+	/* Create address books for existing sources */
         for (i = e_source_list_peek_groups (priv->addressbook_sources); i; i = i->next) {
                 ESourceGroup *source_group = E_SOURCE_GROUP (i->data);
 
Index: backends/file/e-cal-backend-file.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/file/e-cal-backend-file.c,v
retrieving revision 1.63
diff -u -p -r1.63 e-cal-backend-file.c
--- backends/file/e-cal-backend-file.c	11 Oct 2005 07:56:18 -0000	1.63
+++ backends/file/e-cal-backend-file.c	20 Oct 2005 12:15:08 -0000
@@ -92,7 +92,8 @@ static void e_cal_backend_file_finalize 
 
 static ECalBackendSyncClass *parent_class;
 
-
+static ECalBackendSyncStatus
+e_cal_backend_file_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj);
 
 /* g_hash_table_foreach() callback to destroy a ECalBackendFileObject */
 static void
@@ -895,6 +896,9 @@ e_cal_backend_file_open (ECalBackendSync
 			status = create_cal (cbfile, str_uri);
 	}
 
+	if (status == GNOME_Evolution_Calendar_Success)
+		e_cal_backend_file_add_timezone (backend, cal, (const char *) icaltimezone_get_tzid (priv->default_zone));
+
 	g_free (str_uri);
 
 	return status;
@@ -1175,20 +1179,14 @@ e_cal_backend_file_set_default_timezone 
 {
 	ECalBackendFile *cbfile;
 	ECalBackendFilePrivate *priv;
-	icaltimezone *zone;
 
 	cbfile = E_CAL_BACKEND_FILE (backend);
 	priv = cbfile->priv;
 
 	g_return_val_if_fail (priv->icalcomp != NULL, GNOME_Evolution_Calendar_NoSuchCal);
 
-	/* Look up the VTIMEZONE in our icalcomponent. */
-	zone = icalcomponent_get_timezone (priv->icalcomp, tzid);
-	if (!zone)
-		return GNOME_Evolution_Calendar_ObjectNotFound;
-
 	/* Set the default timezone to it. */
-	priv->default_zone = zone;
+	priv->default_zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
 
 	return GNOME_Evolution_Calendar_Success;
 }
Index: backends/groupwise/e-cal-backend-groupwise.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/groupwise/e-cal-backend-groupwise.c,v
retrieving revision 1.170
diff -u -p -r1.170 e-cal-backend-groupwise.c
--- backends/groupwise/e-cal-backend-groupwise.c	11 Oct 2005 07:56:18 -0000	1.170
+++ backends/groupwise/e-cal-backend-groupwise.c	20 Oct 2005 12:15:08 -0000
@@ -72,6 +72,8 @@ struct _ECalBackendGroupwisePrivate {
 static void e_cal_backend_groupwise_dispose (GObject *object);
 static void e_cal_backend_groupwise_finalize (GObject *object);
 static void sanitize_component (ECalBackendSync *backend, ECalComponent *comp, char *server_uid);
+static ECalBackendSyncStatus
+e_cal_backend_groupwise_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj);
 
 #define PARENT_TYPE E_TYPE_CAL_BACKEND_SYNC
 static ECalBackendClass *parent_class = NULL;
@@ -856,6 +858,9 @@ connect_to_server (ECalBackendGroupwise 
 				return GNOME_Evolution_Calendar_OtherError;
 			}
 
+			e_cal_backend_cache_put_default_timezone (priv->cache, priv->default_zone);
+			e_cal_backend_groupwise_add_timezone (E_CAL_BACKEND_SYNC (cbgw), NULL, (const char *) icaltimezone_get_tzid (priv->default_zone));
+
 			/* spawn a new thread for opening the calendar */
 			thread = g_thread_create ((GThreadFunc) cache_init, cbgw, FALSE, &error);
 			if (!thread) {
@@ -1101,6 +1106,9 @@ e_cal_backend_groupwise_open (ECalBacken
 			}
 		}
 		
+		e_cal_backend_cache_put_default_timezone (priv->cache, priv->default_zone);
+		e_cal_backend_groupwise_add_timezone (backend, cal, (const char *) icaltimezone_get_tzid (priv->default_zone));
+
 		g_mutex_unlock (priv->mutex);	
 		return GNOME_Evolution_Calendar_Success;
 	}
@@ -1360,9 +1368,6 @@ e_cal_backend_groupwise_set_default_time
 	
 	/* Set the default timezone to it. */
 	priv->default_zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
-
-	/* FIXME  write it into the cache*/
-	e_cal_backend_cache_put_default_timezone (priv->cache, priv->default_zone);
 
 	return GNOME_Evolution_Calendar_Success;
 }
Index: backends/http/e-cal-backend-http.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/http/e-cal-backend-http.c,v
retrieving revision 1.41
diff -u -p -r1.41 e-cal-backend-http.c
--- backends/http/e-cal-backend-http.c	20 Oct 2005 12:00:38 -0000	1.41
+++ backends/http/e-cal-backend-http.c	20 Oct 2005 12:15:09 -0000
@@ -76,6 +76,8 @@ struct _ECalBackendHttpPrivate {
 static void e_cal_backend_http_dispose (GObject *object);
 static void e_cal_backend_http_finalize (GObject *object);
 static gboolean begin_retrieval_cb (ECalBackendHttp *cbhttp);
+static ECalBackendSyncStatus
+e_cal_backend_http_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj);
 
 static ECalBackendSyncClass *parent_class;
 
@@ -496,12 +498,18 @@ e_cal_backend_http_open (ECalBackendSync
 	if (!priv->cache) {
 		priv->cache = e_cal_backend_cache_new (e_cal_backend_get_uri (E_CAL_BACKEND (backend)));
 
+
 		if (!priv->cache) {
 			e_cal_backend_notify_error (E_CAL_BACKEND(cbhttp), _("Could not create cache file"));
 			return GNOME_Evolution_Calendar_OtherError;	
 		}
-		if (priv->mode == CAL_MODE_LOCAL)
+		
+		e_cal_backend_cache_put_default_timezone (priv->cache, priv->default_zone);
+		e_cal_backend_http_add_timezone (backend, cal, (const char *) icaltimezone_get_tzid (priv->default_zone));
+	
+		if (priv->mode == CAL_MODE_LOCAL) 
 			return GNOME_Evolution_Calendar_Success;
+		
 
 		g_idle_add ((GSourceFunc) begin_retrieval_cb, cbhttp);
 	}
@@ -722,7 +730,9 @@ e_cal_backend_http_set_default_timezone 
 	cbhttp = E_CAL_BACKEND_HTTP (backend);
 	priv = cbhttp->priv;
 	
-	/* FIXME */
+	/* Set the default timezone to it. */
+	priv->default_zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
+	
 	return GNOME_Evolution_Calendar_Success;
 }
 
Index: backends/weather/e-cal-backend-weather.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/weather/e-cal-backend-weather.c,v
retrieving revision 1.13
diff -u -p -r1.13 e-cal-backend-weather.c
--- backends/weather/e-cal-backend-weather.c	11 Oct 2005 07:56:19 -0000	1.13
+++ backends/weather/e-cal-backend-weather.c	20 Oct 2005 12:15:09 -0000
@@ -32,7 +32,9 @@
 static gboolean reload_cb (ECalBackendWeather *cbw);
 static gboolean begin_retrieval_cb (ECalBackendWeather *cbw);
 static ECalComponent* create_weather (ECalBackendWeather *cbw, WeatherForecast *report);
-
+static ECalBackendSyncStatus
+e_cal_backend_weather_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj);
+	
 /* Private part of the ECalBackendWeather structure */
 struct _ECalBackendWeatherPrivate {
 	/* URI to get remote weather data from */
@@ -440,9 +442,11 @@ e_cal_backend_weather_open (ECalBackendS
 	if (priv->city)
 		g_free (priv->city);
 	priv->city = g_strdup (strrchr (uri, '/') + 1);
-
+	
 	if (!priv->cache) {
 		priv->cache = e_cal_backend_cache_new (uri);
+
+		e_cal_backend_weather_add_timezone (backend, cal, (const char *) icaltimezone_get_tzid (priv->default_zone));
 
 		if (!priv->cache) {
 			e_cal_backend_notify_error (E_CAL_BACKEND (cbw), _("Could not create cache file"));
Index: libecal/e-cal.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libecal/e-cal.c,v
retrieving revision 1.120
diff -u -p -r1.120 e-cal.c
--- libecal/e-cal.c	19 Oct 2005 09:59:49 -0000	1.120
+++ libecal/e-cal.c	20 Oct 2005 12:15:09 -0000
@@ -5002,16 +5002,7 @@ e_cal_set_default_timezone (ECal *ecal, 
 	if (priv->default_zone == zone)
 		return FALSE;
 	
-	/* Make sure the server has the VTIMEZONE data. */
-	if (!e_cal_ensure_timezone_on_server (ecal, zone, error))
-		return FALSE;
-
 	g_mutex_lock (priv->mutex);
-
-	if (ecal->priv->load_state != E_CAL_LOAD_LOADED) {
-		g_mutex_unlock (ecal->priv->mutex);
-		E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_URI_NOT_LOADED, error);
-	}
 
 	if (ecal->priv->current_op != NULL) {
 		g_mutex_unlock (ecal->priv->mutex);


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