aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorJP Rosevear <jpr@novell.com>2004-06-04 23:29:35 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-06-04 23:29:35 +0800
commit34723727df71c2c1a7631f2386f1b5936322d4ad (patch)
tree036cd98d522155795f0756f12e1728e86fbe7dc3 /calendar/gui
parentedf893f9e9bffe1ac7bcf3e8080eb1b7728ff2b7 (diff)
downloadgsoc2013-evolution-34723727df71c2c1a7631f2386f1b5936322d4ad.tar.gz
gsoc2013-evolution-34723727df71c2c1a7631f2386f1b5936322d4ad.tar.zst
gsoc2013-evolution-34723727df71c2c1a7631f2386f1b5936322d4ad.zip
make purging actually work
2004-06-04 JP Rosevear <jpr@novell.com> * gui/gnome-cal.c (gnome_calendar_purge): make purging actually work svn path=/trunk/; revision=26213
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/gnome-cal.c16
1 files changed, 6 insertions, 10 deletions
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);
}
}