summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@novell.com>2004-05-27 15:27:42 +0000
committerRodrigo Moya <rodrigo@src.gnome.org>2004-05-27 15:27:42 +0000
commit08d0ddad8f4f4887f21d15b010803912500790e6 (patch)
tree739a7405a7d3476512554f4a1e229b5e557cc010
parente0bd7a5187a91d27d181fe1aa62f7568520077c6 (diff)
downloadevolution-data-server-08d0ddad8f4f4887f21d15b010803912500790e6.tar.gz
make sure we clean up the cache, or old events will always be kept.
2004-05-27 Rodrigo Moya <rodrigo@novell.com> * backends/http/e-cal-backend-http.c (retrieval_done): make sure we clean up the cache, or old events will always be kept.
-rw-r--r--calendar/ChangeLog5
-rw-r--r--calendar/backends/http/e-cal-backend-http.c30
2 files changed, 27 insertions, 8 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index c2b96437e..01f2721bf 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,10 @@
2004-05-27 Rodrigo Moya <rodrigo@novell.com>
+ * backends/http/e-cal-backend-http.c (retrieval_done): make sure
+ we clean up the cache, or old events will always be kept.
+
+2004-05-27 Rodrigo Moya <rodrigo@novell.com>
+
Fixes #58197
* libedata-cal/e-cal-backend.c (e_cal_backend_create_object,
diff --git a/calendar/backends/http/e-cal-backend-http.c b/calendar/backends/http/e-cal-backend-http.c
index 55d430a11..8a2c70744 100644
--- a/calendar/backends/http/e-cal-backend-http.c
+++ b/calendar/backends/http/e-cal-backend-http.c
@@ -258,19 +258,33 @@ retrieval_done (SoupMessage *msg, ECalBackendHttp *cbhttp)
}
/* Update cache */
+ e_file_cache_clean (E_FILE_CACHE (priv->cache));
+
kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbhttp));
- subcomp = icalcomponent_get_first_component (icalcomp, kind);
+ subcomp = icalcomponent_get_first_component (icalcomp, ICAL_ANY_COMPONENT);
while (subcomp) {
ECalComponent *comp;
+ icalcomponent_kind subcomp_kind;
+
+ subcomp_kind = icalcomponent_isa (subcomp);
+ if (subcomp_kind == kind) {
+ comp = e_cal_component_new ();
+ if (e_cal_component_set_icalcomponent (comp, subcomp)) {
+ e_cal_backend_cache_put_component (priv->cache, comp);
+ e_cal_backend_notify_object_created (E_CAL_BACKEND (cbhttp),
+ icalcomponent_as_ical_string (subcomp));
+ }
- comp = e_cal_component_new ();
- if (e_cal_component_set_icalcomponent (comp, subcomp)) {
- e_cal_backend_cache_put_component (priv->cache, comp);
- e_cal_backend_notify_object_created (E_CAL_BACKEND (cbhttp),
- icalcomponent_as_ical_string (subcomp));
- }
+ g_object_unref (comp);
+ } else if (subcomp_kind == ICAL_VTIMEZONE_COMPONENT) {
+ icaltimezone *zone;
- g_object_unref (comp);
+ zone = icaltimezone_new ();
+ icaltimezone_set_component (zone, subcomp);
+ e_cal_backend_cache_put_timezone (priv->cache, (const icaltimezone *) zone);
+
+ icaltimezone_free (zone, 1);
+ }
subcomp = icalcomponent_get_next_component (icalcomp, kind);
}