From 648299572f0fa56e6ea260329cd8e616e12957fb Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Fri, 13 Jan 2006 09:44:48 +0000 Subject: fixes #313112 svn path=/trunk/; revision=31161 --- calendar/ChangeLog | 8 +++++++- calendar/gui/e-calendar-view.c | 17 ++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 9260eeeee5..050c6201e7 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,4 +1,10 @@ -2006-01-14 Chenthill Palanisamy +2006-01-13 Chenthill Palanisamy + + Fixes #313112 + * gui/e-calendar-view.c: (on_unrecur_appointment): + Remove the old instance if its a detached instance. + +2006-01-13 Chenthill Palanisamy Fixes #259505 * gui/gnome-cal.c: diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 95eca81959..3de3c090d9 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -1449,9 +1449,12 @@ 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)); - 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); + + 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); + } /* For the unrecurred instance we duplicate the original object, create a new uid for it, get rid of the recurrence rules, and set @@ -1482,8 +1485,16 @@ 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!"); + } g_object_unref (comp); -- cgit v1.2.3