From 2672a514132dcebab710c90aef78c464708eae6f Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Fri, 10 Feb 2006 06:34:55 +0000 Subject: fixes #329570 svn path=/trunk/; revision=31471 --- calendar/gui/e-calendar-view.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 9e10669186..da6b7626db 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -1472,7 +1472,8 @@ on_unrecur_appointment (EPopup *ep, EPopupItem *pitem, void *data) GList *selected; ECal *client; char *new_uid; - + ECalComponentId *id = NULL; + selected = e_calendar_view_get_selected_events (cal_view); if (!selected) return; @@ -1488,13 +1489,9 @@ on_unrecur_appointment (EPopup *ep, EPopupItem *pitem, void *data) comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); - - if (e_cal_component_has_recurrences (comp)) { - e_cal_component_set_recurid (comp, NULL); - cal_comp_util_add_exdate (comp, event->comp_data->instance_start, e_calendar_view_get_timezone (cal_view)); - e_cal_component_commit_sequence (comp); - } + id = e_cal_component_get_id (comp); + /* For the unrecurred instance we duplicate the original object, create a new uid for it, get rid of the recurrence rules, and set the start & end times to the instances times. */ @@ -1524,17 +1521,12 @@ on_unrecur_appointment (EPopup *ep, EPopupItem *pitem, void *data) /* Now update both ECalComponents. Note that we do this last since at * present the updates happen synchronously so our event may disappear. */ - if (e_cal_component_has_recurrences (comp)) { - if (!e_cal_modify_object (client, e_cal_component_get_icalcomponent (comp), CALOBJ_MOD_ALL, NULL)) - g_message ("on_unrecur_appointment(): Could not update the object!"); - } else { - ECalComponentId *id = e_cal_component_get_id (comp); - if (!e_cal_remove_object_with_mod (client, id->uid, id->rid, CALOBJ_MOD_THIS, - NULL)); - g_message ("on_unrecur_appointment(): Could not remove the old object!"); - } + if (!e_cal_remove_object_with_mod (client, id->uid, id->rid, CALOBJ_MOD_THIS, + NULL)) + g_message ("on_unrecur_appointment(): Could not remove the old object!"); + e_cal_component_free_id (id); g_object_unref (comp); if (!e_cal_create_object (client, e_cal_component_get_icalcomponent (new_comp), &new_uid, NULL)) -- cgit v1.2.3