diff options
author | Chenthill Palanisamy <pchen@src.gnome.org> | 2006-01-24 15:27:06 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2006-01-24 15:27:06 +0800 |
commit | c9d938050f9d7177795303ff6eb10c7e118f551c (patch) | |
tree | 2389c9ac0a586bd758d7243c5dd094ef29bd086a /calendar | |
parent | 5838198ed2213228ec1808f8721a94082377c206 (diff) | |
download | gsoc2013-evolution-c9d938050f9d7177795303ff6eb10c7e118f551c.tar gsoc2013-evolution-c9d938050f9d7177795303ff6eb10c7e118f551c.tar.gz gsoc2013-evolution-c9d938050f9d7177795303ff6eb10c7e118f551c.tar.bz2 gsoc2013-evolution-c9d938050f9d7177795303ff6eb10c7e118f551c.tar.lz gsoc2013-evolution-c9d938050f9d7177795303ff6eb10c7e118f551c.tar.xz gsoc2013-evolution-c9d938050f9d7177795303ff6eb10c7e118f551c.tar.zst gsoc2013-evolution-c9d938050f9d7177795303ff6eb10c7e118f551c.zip |
fixes #323700
svn path=/trunk/; revision=31293
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 9 | ||||
-rw-r--r-- | 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 <pchenthill@novell.com> + + 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 <hernandez@movimage.com> ** 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); + } } } |