From 34723727df71c2c1a7631f2386f1b5936322d4ad Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Fri, 4 Jun 2004 15:29:35 +0000 Subject: make purging actually work 2004-06-04 JP Rosevear * gui/gnome-cal.c (gnome_calendar_purge): make purging actually work svn path=/trunk/; revision=26213 --- calendar/gui/gnome-cal.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index d5cf2336a0..63379c2d52 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -2909,10 +2909,9 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than) for (l = priv->clients_list[E_CAL_SOURCE_TYPE_EVENT]; l != NULL; l = l->next) { ECal *client = l->data; GList *objects, *m; - gboolean read_only = TRUE; + gboolean read_only; - e_cal_is_read_only (client, &read_only, NULL); - if (!read_only) + if (!e_cal_is_read_only (client, &read_only, NULL) || read_only) continue; if (!e_cal_get_object_list (client, sexp, &objects, NULL)) { @@ -2922,22 +2921,19 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than) } for (m = objects; m; m = m->next) { - ECalComponent *comp; gboolean remove = TRUE; - comp = e_cal_component_new (); - e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (m->data)); - + /* 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, - older_than, -1, + older_than, G_MAXINT32, (ECalRecurInstanceFn) check_instance_cb, &remove); /* FIXME Better error handling */ if (remove) e_cal_remove_object (client, icalcomponent_get_uid (m->data), NULL); - - g_object_unref (comp); } } -- cgit