[evolution-patches] A patch for calendar based on trunk



Hi,

This patch is aimed for trunk. We have found a bug in calendar which can be reproduced as follows:
1. Invoke your evolution
2. Create an all-day event
3. Drag its left/right edge to make it a two-day-long event
4. Open it

As your can see, the event is still one-day long. That's because someone forgot to call e_cal_component_commit_sequence after updating the start/end time of the event. After fixing that , there's still some problem with it. The new event has different
time zone setting for its start time and end time.

Enclosed is a patch to fix these two problems. Would you like to spend a little time to review it?

Best regards
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2183
diff -u -r1.2183 ChangeLog
--- calendar/ChangeLog	5 Mar 2004 11:42:18 -0000	1.2183
+++ calendar/ChangeLog	8 Mar 2004 08:11:32 -0000
@@ -1,3 +1,10 @@
+2004-03-08  Kidd Wang  <kidd wang sun com>
+
+	* gui/e-day-view.c: (e_day_view_finish_long_event_resize): add a call
+	to e_cal_component_commit_sequence since we have changed the property
+	of the component. Whether the new event is all day should also be
+	set properly according to the value of the original event.
+
 2004-03-05  Rodrigo Moya <rodrigo ximian com>
 
 	* gui/alarm-notify/alarm-notify.c (alarm_notify_init): set a GConf
Index: calendar/gui/e-day-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-day-view.c,v
retrieving revision 1.236
diff -u -r1.236 e-day-view.c
--- calendar/gui/e-day-view.c	27 Feb 2004 15:56:26 -0000	1.236
+++ calendar/gui/e-day-view.c	8 Mar 2004 08:11:34 -0000
@@ -3730,6 +3730,7 @@
 	ECal *client;
 	CalObjModType mod = CALOBJ_MOD_ALL;
 	GtkWindow *toplevel;
+	int is_date;
 	
 	event_num = day_view->resize_event_num;
 	event = &g_array_index (day_view->long_events, EDayViewEvent,
@@ -3744,18 +3745,24 @@
 	e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
 
 	date.value = &itt;
-	/* FIXME: Should probably keep the timezone of the original start
-	   and end times. */
-	date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+	date.tzid = NULL;
 
 	if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_LEFT_EDGE) {
+		e_cal_component_get_dtstart (comp, &date);
+		is_date = date.value->is_date;
+		if (!is_date)
+			date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
 		dt = day_view->day_starts[day_view->resize_start_row];
-		*date.value = icaltime_from_timet_with_zone (dt, FALSE,
+		*date.value = icaltime_from_timet_with_zone (dt, is_date,
 							     e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
 		e_cal_component_set_dtstart (comp, &date);
 	} else {
+		e_cal_component_get_dtend (comp, &date);
+		is_date = date.value->is_date;
+		if (!is_date)
+			date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
 		dt = day_view->day_starts[day_view->resize_end_row + 1];
-		*date.value = icaltime_from_timet_with_zone (dt, FALSE,
+		*date.value = icaltime_from_timet_with_zone (dt, is_date,
 							     e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
 		e_cal_component_set_dtend (comp, &date);
 	}
@@ -3769,6 +3776,7 @@
 	
 	toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view)));
 	
+	e_cal_component_commit_sequence (comp);
 	e_calendar_view_modify_and_send (comp, client, mod, toplevel, TRUE);
 	
  out:


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