[evolution-patches] another small patch for recurrences



this fixes 'delete this occurrence', which was not working correctly in
some cases.
-- 
Rodrigo Moya <rodrigo novell com>
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2681
diff -u -p -r1.2681 ChangeLog
--- ChangeLog	4 Mar 2005 14:39:12 -0000	1.2681
+++ ChangeLog	4 Mar 2005 21:00:27 -0000
@@ -1,3 +1,11 @@
+2005-xx-xx  Rodrigo Moya <rodrigo novell com>
+
+	* gui/e-cal-model.c (set_instance_times): don't use the RECURRENCE-ID
+	to get the datetime.
+
+	* gui/e-calendar-view.c (e_calendar_view_delete_selected_occurrence):
+	exceptions need to be date only.
+	
 2005-03-04  Rodrigo Moya <rodrigo novell com>
 
 	Fixes #72835
Index: gui/e-cal-model.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-model.c,v
retrieving revision 1.55
diff -u -p -r1.55 e-cal-model.c
--- gui/e-cal-model.c	10 Feb 2005 08:42:08 -0000	1.55
+++ gui/e-cal-model.c	4 Mar 2005 21:00:27 -0000
@@ -1301,12 +1301,7 @@ set_instance_times (ECalModelComponent *
 	start_time = icalcomponent_get_dtstart (comp_data->icalcomp);
 	end_time = icalcomponent_get_dtend (comp_data->icalcomp);
 
-	if (e_cal_util_component_is_instance (comp_data->icalcomp)) {
-		itt = icaltime_convert_to_zone (recur_time, icaltimezone_get_utc_timezone ());
-		comp_data->instance_start = icaltime_as_timet (itt);
-	} else {
-		comp_data->instance_start = icaltime_as_timet (start_time);
-	}
+	comp_data->instance_start = icaltime_as_timet (start_time);
 
 	comp_data->instance_end = comp_data->instance_start +
 		(icaltime_as_timet (end_time) - icaltime_as_timet (start_time));
Index: gui/e-calendar-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-view.c,v
retrieving revision 1.76
diff -u -p -r1.76 e-calendar-view.c
--- gui/e-calendar-view.c	4 Feb 2005 12:18:51 -0000	1.76
+++ gui/e-calendar-view.c	4 Mar 2005 21:00:27 -0000
@@ -883,6 +883,9 @@ e_calendar_view_delete_selected_occurren
 	const char *uid, *rid = NULL;
 	GError *error = NULL;
 	ECalComponent *comp;
+	struct icaltimetype itt;
+	ECalComponentDateTime dt;
+	icaltimezone *zone;
 		
 	selected = e_calendar_view_get_selected_events (cal_view);
 	if (!selected)
@@ -893,27 +896,17 @@ e_calendar_view_delete_selected_occurren
 	comp = e_cal_component_new ();
 	e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
 	e_cal_component_get_uid (comp, &uid);
-	if (e_cal_component_is_instance (comp))
-		rid = e_cal_component_get_recurid_as_string (comp);
-	else {
-		ECalComponentDateTime dt;
-		icaltimezone *zone;
 
-		if (!e_cal_component_has_recurrences (comp)) {
-			g_object_unref (comp);
-			return;
-		}
+	e_cal_component_get_dtstart (comp, &dt);
+	e_cal_get_timezone (event->comp_data->client, dt.tzid, &zone, NULL);
 
-		/* get the RECUR-ID from the instance start date */
-		e_cal_component_get_dtstart (comp, &dt);
-		if (e_cal_get_timezone (event->comp_data->client, dt.tzid, &zone, NULL)) {
-			rid = icaltime_as_ical_string (
-				icaltime_from_timet_with_zone (event->comp_data->instance_start, TRUE, zone));
-		} else
-			rid = icaltime_as_ical_string (icaltime_from_timet (event->comp_data->instance_start, TRUE));
+	if (zone)
+		itt = icaltime_from_timet_with_zone (event->comp_data->instance_start, TRUE, zone);
+	else
+		itt = icaltime_from_timet (event->comp_data->instance_start, TRUE);
+	rid = icaltime_as_ical_string (itt);
 
-		e_cal_component_free_datetime (&dt);
-	}
+	e_cal_component_free_datetime (&dt);
 
 	if (rid) {
 		if (delete_component_dialog (comp, FALSE, 1, e_cal_component_get_vtype (comp), GTK_WIDGET (cal_view))) {


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