[evolution-patches] fix for the bug #308802 [calendar]



Hi,
   Have attached the fix for the bug. Some items does not appear in the
view due to a timezone issue since they are stored in UTC timezone at
the backend. The calendar items are loaded in the e_cal_open method, so
the default timezone needs to be set before the items are loaded. The
appearance of the detached instances in all views would be fixed by the
patch from 266144.

thanks, Chenthill.
? 244981.diff
? 246480.diff
? 273847.diff
? 301391.diff
? 308802.diff
? 315095.diff
? 316954.diff
? calendar.error
? temp
? gui/apps_evolution_calendar-2.4.schemas
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2825
diff -u -p -r1.2825 ChangeLog
--- ChangeLog	3 Oct 2005 11:20:50 -0000	1.2825
+++ ChangeLog	5 Oct 2005 19:17:33 -0000
@@ -1,3 +1,19 @@
+2005-10-05  Chenthill Palanisamy  <pchenthill novell com>
+
+	Fixes #308802
+	* gui/calendar-component.c: (setup_create_ecal):
+	* gui/dialogs/event-page.c: (source_changed_cb):
+	* gui/dialogs/task-page.c: (source_changed_cb):
+	* gui/e-itip-control.c: (cal_opened_cb), (start_calendar_server),
+	(find_cal_opened_cb):
+	* gui/e-tasks.c: (set_timezone), (client_cal_opened_cb),
+	(default_client_cal_opened_cb), (open_ecal):
+	* gui/gnome-cal.c: (client_cal_opened_cb),
+	(default_client_cal_opened_cb), (open_ecal),
+	(gnome_calendar_set_default_source):
+	* gui/tasks-component.c: (setup_create_ecal): Set the default
+	timezone in the ecal once its created and before opening ecal.
+
 2005-10-02  Srinivasa Ragavan <sragavan novell com>
 	
 	Provides across calendars keyboard accelerators for popup menus
Index: gui/calendar-component.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/calendar-component.c,v
retrieving revision 1.208
diff -u -p -r1.208 calendar-component.c
--- gui/calendar-component.c	3 Oct 2005 11:20:51 -0000	1.208
+++ gui/calendar-component.c	5 Oct 2005 19:17:40 -0000
@@ -1145,6 +1145,9 @@ setup_create_ecal (CalendarComponent *ca
 		
 	if (priv->create_ecal) {
 		icaltimezone *zone;
+		
+		zone = calendar_config_get_icaltimezone ();
+		e_cal_set_default_timezone (priv->create_ecal, zone, NULL);
 
 		if (!e_cal_open (priv->create_ecal, FALSE, NULL)) {
 			GtkWidget *dialog;
@@ -1158,9 +1161,6 @@ setup_create_ecal (CalendarComponent *ca
 
 			return NULL;
 		}
-
-		zone = calendar_config_get_icaltimezone ();
-		e_cal_set_default_timezone (priv->create_ecal, zone, NULL);
 
 	} else {
 		GtkWidget *dialog;
Index: gui/e-itip-control.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-itip-control.c,v
retrieving revision 1.167
diff -u -p -r1.167 e-itip-control.c
--- gui/e-itip-control.c	24 Aug 2005 03:07:49 -0000	1.167
+++ gui/e-itip-control.c	5 Oct 2005 19:18:00 -0000
@@ -149,7 +149,6 @@ cal_opened_cb (ECal *ecal, ECalendarStat
 	EItipControlPrivate *priv;
 	ESource *source;
 	ECalSourceType source_type;
-	icaltimezone *zone;
 
 	priv = itip->priv;
 
@@ -164,9 +163,6 @@ cal_opened_cb (ECal *ecal, ECalendarStat
 		return;
 	}
 
-	zone = calendar_config_get_icaltimezone ();
-	e_cal_set_default_timezone (ecal, zone, NULL);
-
 	priv->current_ecal = ecal;
 	set_ok_sens (itip);
 }
@@ -178,6 +174,7 @@ start_calendar_server (EItipControl *iti
 {
 	EItipControlPrivate *priv;
 	ECal *ecal;
+	icaltimezone *zone;
 
 	priv = itip->priv;
 	
@@ -189,6 +186,10 @@ start_calendar_server (EItipControl *iti
 	}
 	
 	ecal = auth_new_cal_from_source (source, type);
+	
+	zone = calendar_config_get_icaltimezone ();
+	e_cal_set_default_timezone (ecal, zone, NULL);
+	
 	g_signal_connect (G_OBJECT (ecal), "cal_opened", G_CALLBACK (func), data);
 
 	g_hash_table_insert (priv->ecals[type], g_strdup (e_source_peek_uid (source)), ecal);
@@ -246,7 +247,6 @@ find_cal_opened_cb (ECal *ecal, ECalenda
 	ESource *source;
 	ECalSourceType source_type;
 	icalcomponent *icalcomp;
-	icaltimezone *zone;
 
 	source_type = e_cal_get_source_type (ecal);
 	source = e_cal_get_source (ecal);
@@ -269,9 +269,6 @@ find_cal_opened_cb (ECal *ecal, ECalenda
 		priv->current_ecal = ecal;
 		set_ok_sens (fd->itip);
 	}
-
-	zone = calendar_config_get_icaltimezone ();
-	e_cal_set_default_timezone (ecal, zone, NULL);
 
  cleanup:
 	if (fd->count == 0) {
Index: gui/e-tasks.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-tasks.c,v
retrieving revision 1.122
diff -u -p -r1.122 e-tasks.c
--- gui/e-tasks.c	3 Oct 2005 06:16:51 -0000	1.122
+++ gui/e-tasks.c	5 Oct 2005 19:18:04 -0000
@@ -258,13 +258,11 @@ set_timezone (ETasks *tasks) 
 	zone = calendar_config_get_icaltimezone ();
 	for (l = priv->clients_list; l != NULL; l = l->next) {
 		ECal *client = l->data;
-
-		if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED)
-			/* FIXME Error checking */
-			e_cal_set_default_timezone (client, zone, NULL);
+		/* FIXME Error checking */
+		e_cal_set_default_timezone (client, zone, NULL);
 	}
 
-	if (priv->default_client && e_cal_get_load_state (priv->default_client) == E_CAL_LOAD_LOADED)
+	if (priv->default_client) 
 		/* FIXME Error checking */
 		e_cal_set_default_timezone (priv->default_client, zone, NULL);
 
@@ -869,7 +867,6 @@ client_cal_opened_cb (ECal *ecal, ECalen
 		model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
 		e_cal_model_add_client (model, ecal);
 
-		set_timezone (tasks);
 		set_status_message (tasks, NULL);
 		break;
 	case E_CALENDAR_STATUS_BUSY :
@@ -912,7 +909,6 @@ default_client_cal_opened_cb (ECal *ecal
 		g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, default_client_cal_opened_cb, NULL);
 		model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
 		
-		set_timezone (tasks);
 		e_cal_model_set_default_client (model, ecal);
 		set_status_message (tasks, NULL);
 		break;
@@ -946,8 +942,13 @@ static gboolean
 open_ecal (ETasks *tasks, ECal *cal, gboolean only_if_exists, open_func of)
 {
 	ETasksPrivate *priv;
+	icaltimezone *zone;
 
 	priv = tasks->priv;
+	
+	zone = calendar_config_get_icaltimezone ();
+	e_cal_set_default_timezone (priv->default_client, zone, NULL);
+
 	
 	set_status_message (tasks, _("Opening tasks at %s"), e_cal_get_uri (cal));
 
Index: gui/gnome-cal.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/gnome-cal.c,v
retrieving revision 1.389
diff -u -p -r1.389 gnome-cal.c
--- gui/gnome-cal.c	3 Oct 2005 11:20:51 -0000	1.389
+++ gui/gnome-cal.c	5 Oct 2005 19:18:18 -0000
@@ -2390,7 +2390,6 @@ client_cal_opened_cb (ECal *ecal, ECalen
 
 	g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, client_cal_opened_cb, NULL);
 
-	e_cal_set_default_timezone (ecal, priv->zone, NULL);
 
 	switch (source_type) {
 	case E_CAL_SOURCE_TYPE_EVENT :
@@ -2484,7 +2483,6 @@ default_client_cal_opened_cb (ECal *ecal
 
 	g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, default_client_cal_opened_cb, NULL);
 
-	e_cal_set_default_timezone (ecal, priv->zone, NULL);
 	
 	switch (source_type) {
 	case E_CAL_SOURCE_TYPE_EVENT:
@@ -2511,9 +2509,13 @@ open_ecal (GnomeCalendar *gcal, ECal *ca
 {
 	GnomeCalendarPrivate *priv;
 	char *msg;
+	icaltimezone *zone;
 
 	priv = gcal->priv;
 
+	zone = calendar_config_get_icaltimezone ();
+	e_cal_set_default_timezone (cal, zone, NULL);
+	
 	msg = g_strdup_printf (_("Opening %s"), e_cal_get_uri (cal));
 	switch (e_cal_get_source_type (cal)) {
 	case E_CAL_SOURCE_TYPE_EVENT :
@@ -2882,6 +2884,7 @@ gnome_calendar_set_default_source (Gnome
 		if (!priv->default_client[source_type])
 			return FALSE;
 	}
+	
 
 	open_ecal (gcal, priv->default_client[source_type], FALSE, default_client_cal_opened_cb);
 
Index: gui/tasks-component.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/tasks-component.c,v
retrieving revision 1.92
diff -u -p -r1.92 tasks-component.c
--- gui/tasks-component.c	3 Oct 2005 11:20:51 -0000	1.92
+++ gui/tasks-component.c	5 Oct 2005 19:18:26 -0000
@@ -863,6 +863,9 @@ setup_create_ecal (TasksComponent *compo
 		
 	if (priv->create_ecal) {
 		icaltimezone *zone;
+		
+		zone = calendar_config_get_icaltimezone ();
+		e_cal_set_default_timezone (priv->create_ecal, zone, NULL);
 
 		if (!e_cal_open (priv->create_ecal, FALSE, NULL)) {
 			GtkWidget *dialog;
@@ -877,8 +880,6 @@ setup_create_ecal (TasksComponent *compo
 			return NULL;
 		}
 
-		zone = calendar_config_get_icaltimezone ();
-		e_cal_set_default_timezone (priv->create_ecal, zone, NULL);
 	} else {
 		GtkWidget *dialog;
 			
Index: gui/dialogs/event-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/event-page.c,v
retrieving revision 1.88
diff -u -p -r1.88 event-page.c
--- gui/dialogs/event-page.c	18 Aug 2005 11:20:23 -0000	1.88
+++ gui/dialogs/event-page.c	5 Oct 2005 19:18:36 -0000
@@ -1672,6 +1672,13 @@ source_changed_cb (GtkWidget *widget, ES
 		ECal *client;
 
 		client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT);
+		if (client) {
+			icaltimezone *zone;
+			
+			zone = calendar_config_get_icaltimezone ();
+			e_cal_set_default_timezone (client, zone, NULL);
+		}
+
 		if (!client || !e_cal_open (client, FALSE, NULL)) {
 			GtkWidget *dialog;
 
@@ -1688,11 +1695,6 @@ source_changed_cb (GtkWidget *widget, ES
 			gtk_dialog_run (GTK_DIALOG (dialog));
 			gtk_widget_destroy (dialog);
 		} else {
-			icaltimezone *zone;
-			
-			zone = calendar_config_get_icaltimezone ();
-			e_cal_set_default_timezone (client, zone, NULL);
-
 			comp_editor_notify_client_changed (
 				COMP_EDITOR (gtk_widget_get_toplevel (priv->main)),
 				client);
Index: gui/dialogs/task-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-page.c,v
retrieving revision 1.74
diff -u -p -r1.74 task-page.c
--- gui/dialogs/task-page.c	23 Jun 2005 09:11:05 -0000	1.74
+++ gui/dialogs/task-page.c	5 Oct 2005 19:18:38 -0000
@@ -859,6 +859,13 @@ source_changed_cb (GtkWidget *widget, ES
 		ECal *client;
 
 		client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_TODO);
+		if (client) {
+			icaltimezone *zone;
+			
+			zone = calendar_config_get_icaltimezone ();
+			e_cal_set_default_timezone (client, zone, NULL);
+		}
+		
 		if (!client || !e_cal_open (client, FALSE, NULL)) {
 			GtkWidget *dialog;
 


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