summaryrefslogtreecommitdiff
path: root/calendar/backends
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2004-03-19 13:05:39 +0000
committerRodrigo Moya <rodrigo@src.gnome.org>2004-03-19 13:05:39 +0000
commit647ad4598195c97583d8faa1a88f76656439211f (patch)
treed8f48c92bc114b062369a134f67dba870d432298 /calendar/backends
parentbf695d349ebe026e4fc40b9bcfbbed2d0f1107e8 (diff)
downloadevolution-data-server-647ad4598195c97583d8faa1a88f76656439211f.tar.gz
new functions to support timezones in the cache.
2004-03-19 Rodrigo Moya <rodrigo@ximian.com> * libedata-cal/e-cal-backend-cache.[ch] (e_cal_backend_cache_get_timezone, e_cal_backend_cache_put_timezone, e_cal_backend_cache_remove_timezone): new functions to support timezones in the cache. (e_cal_backend_cache_get_components): only append to the returned list the VEVENT's and VTODO's components. (e_cal_backend_cache_init): create a hash table to store all the icaltimezone objects we create in e_cal_backend_cache_get_timezone. (e_cal_backend_cache_finalize): free the timezones hash table. * backends/groupwise/e-cal-backend-groupwise.c (e_cal_backend_groupwise_remove_object): remove object based on the Groupwise item ID, not the iCalendar ID.
Diffstat (limited to 'calendar/backends')
-rw-r--r--calendar/backends/groupwise/e-cal-backend-groupwise.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise.c b/calendar/backends/groupwise/e-cal-backend-groupwise.c
index a79d3e9e6..45c6be201 100644
--- a/calendar/backends/groupwise/e-cal-backend-groupwise.c
+++ b/calendar/backends/groupwise/e-cal-backend-groupwise.c
@@ -976,16 +976,43 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend, EDataCal *cal,
/* if online, remove the item from the server */
if (priv->mode == CAL_MODE_REMOTE) {
EGwConnectionStatus status;
+ char *calobj;
+ icalproperty *icalprop;
+ icalcomponent *icalcomp;
- /* FIXME: deal with recurrences */
- status = e_gw_connection_remove_item (priv->cnc, priv->container_id, uid);
+ status = e_cal_backend_groupwise_get_object (backend, cal, uid, rid, &calobj);
if (status != E_GW_CONNECTION_STATUS_OK)
- return GNOME_Evolution_Calendar_OtherError;
+ return GNOME_Evolution_Calendar_ObjectNotFound;
+
+ icalcomp = icalparser_parse_string (calobj);
+ g_free (calobj);
+ if (!icalcomp)
+ return GNOME_Evolution_Calendar_InvalidObject;
+
+ /* search the component for the X-EVOLUTION-GROUPWISE-ID property */
+ icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
+ while (icalprop) {
+ const char *x_name, *x_val;
+
+ x_name = icalproperty_get_x_name (icalprop);
+ x_val = icalproperty_get_x (icalprop);
+ if (!strcmp (x_name, "X-EVOLUTION-GROUPWISE-ID")) {
+ status = e_gw_connection_remove_item (priv->cnc, priv->container_id, x_val);
+
+ icalcomponent_free (icalcomp);
+ if (status == E_GW_CONNECTION_STATUS_OK)
+ return GNOME_Evolution_Calendar_Success;
+ else
+ return GNOME_Evolution_Calendar_OtherError;
+ }
+
+ icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY);
+ }
}
/* remove the component from the cache */
if (!e_cal_backend_cache_remove_component (priv->cache, uid, rid))
- return E_GW_CONNECTION_STATUS_OBJECT_NOT_FOUND;
+ return GNOME_Evolution_Calendar_ObjectNotFound;
return GNOME_Evolution_Calendar_Success;
}