From c9d938050f9d7177795303ff6eb10c7e118f551c Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Tue, 24 Jan 2006 07:27:06 +0000 Subject: fixes #323700 svn path=/trunk/; revision=31293 --- calendar/ChangeLog | 9 +++++++++ calendar/gui/gnome-cal.c | 26 ++++++++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 98258ac6de..c7ad6f5040 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,12 @@ +2006-01-24 Chenthill Palanisamy + + Fixes #323700 + * gui/gnome-cal.c: + (gnome_calendar_on_date_navigator_selection_changed), + (gnome_calendar_purge): For clients which have no master object + for recurrences need not call generate instances. Pass the + recurrence id to remove the detached instances. + 2005-09-17 Jon Ander Hernandez ** Fixes bug #313118 diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index cc46a97b2a..c32a36bafd 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -3478,7 +3478,8 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than) /* FIXME write occur-before and occur-after * sexp funcs so we don't have to use the max * int */ - e_cal_generate_instances_for_object (client, m->data, + if (!e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER)) + e_cal_generate_instances_for_object (client, m->data, older_than, G_MAXINT32, (ECalRecurInstanceFn) check_instance_cb, &remove); @@ -3486,11 +3487,24 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than) /* FIXME Better error handling */ if (remove) { const char *uid = icalcomponent_get_uid (m->data); - - if (e_cal_util_component_is_instance (m->data) || e_cal_util_component_has_recurrences (m->data)) - e_cal_remove_object_with_mod (client, uid, NULL, CALOBJ_MOD_ALL, NULL); - else - e_cal_remove_object (client, uid, NULL); + GError *error = NULL; + + if (e_cal_util_component_is_instance (m->data) || e_cal_util_component_has_recurrences (m->data)) { + const char *rid = NULL; + struct icaltimetype recur_id = icalcomponent_get_recurrenceid (m->data); + + if (!icaltime_is_null_time (recur_id) ) + rid = icaltime_as_ical_string (recur_id); + + e_cal_remove_object_with_mod (client, uid, rid, CALOBJ_MOD_ALL, &error); + } else { + e_cal_remove_object (client, uid, &error); + } + + if (error) { + g_warning ("Unable to purge events %s \n", error->message); + g_error_free (error); + } } } -- cgit v1.2.3