summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog47
-rw-r--r--calendar/backends/contacts/e-cal-backend-contacts.c15
-rw-r--r--calendar/backends/file/e-cal-backend-file.c17
-rw-r--r--calendar/backends/groupwise/e-cal-backend-groupwise-utils.c74
-rw-r--r--calendar/backends/groupwise/e-cal-backend-groupwise-utils.h2
-rw-r--r--calendar/backends/groupwise/e-cal-backend-groupwise.c213
-rw-r--r--calendar/backends/http/e-cal-backend-http.c7
-rw-r--r--calendar/backends/weather/e-cal-backend-weather.c6
-rw-r--r--calendar/idl/Evolution-DataServer-Calendar.idl13
-rw-r--r--calendar/libecal/e-cal-component.c50
-rw-r--r--calendar/libecal/e-cal-component.h8
-rw-r--r--calendar/libecal/e-cal-view-listener.c30
-rw-r--r--calendar/libecal/e-cal-view.c4
-rw-r--r--calendar/libecal/e-cal.c6
-rw-r--r--calendar/libecal/e-cal.h2
-rw-r--r--calendar/libedata-cal/e-cal-backend-sync.c16
-rw-r--r--calendar/libedata-cal/e-cal-backend.c28
-rw-r--r--calendar/libedata-cal/e-cal-backend.h2
-rw-r--r--calendar/libedata-cal/e-data-cal-view.c80
-rw-r--r--calendar/libedata-cal/e-data-cal-view.h4
-rw-r--r--calendar/libedata-cal/e-data-cal.c4
-rw-r--r--calendar/libedata-cal/e-data-cal.h2
22 files changed, 183 insertions, 447 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 229fac87a..af599d6f3 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,50 +1,3 @@
-2005-10-10 Chenthill Palanisamy <pchenthill@novell.com>
-
- Fixes #266144
- * backends/contacts/e-cal-backend-contacts.c:
- (contact_record_free):
- * backends/http/e-cal-backend-http.c:
- (notify_and_remove_from_cache):
- * backends/weather/e-cal-backend-weather.c:
- (finished_retrieval_cb):
- * backends/file/e-cal-backend-file.c: (notify_removals_cb),
- (e_cal_backend_file_receive_objects): Use ECalComponentId.
- * backends/groupwise/e-cal-backend-groupwise-utils.[ch]:
- (e_gw_item_to_cal_component): Store the recurrence id in
- utc.
- (e_gw_connection_send_appointment): Get the component while
- accepting/declining from mail component and pass all_instances
- and get the partstat.
- the
- * backends/groupwise/e-cal-backend-groupwise.c:
- (e_cal_backend_groupwise_remove_object), (change_status),
- (receive_object): Change the status of all recurring appointments
- if all_instances is set true.
- * idl/Evolution-DataServer-Calendar.idl: Added a structure
- to hold the recurrence id and uid to notify the component
- removed.
- * libecal/e-cal-component.c: (e_cal_component_get_id),
- (e_cal_component_free_id): Added new API's for getting
- the recurrence id and uid of a component.
- * libecal/e-cal-component.h: Added a structure of holding
- both the recurrence id and the uid.
- * libecal/e-cal-view-listener.c: (build_id_list),
- (impl_notifyObjectsRemoved):
- * libecal/e-cal-view.c: (objects_removed_cb):
- * libedata-cal/e-cal-backend-sync.c:
- (_e_cal_backend_remove_object):
- * libedata-cal/e-cal-backend.c: (match_query_and_notify),
- (e_cal_backend_notify_object_removed):
- * libedata-cal/e-cal-backend.h:
- * libedata-cal/e-data-cal-view.c: (uncache_with_id_cb),
- (remove_object_from_cache):
- (e_data_cal_view_notify_objects_removed),
- (e_data_cal_view_notify_objects_removed_1):
- * libedata-cal/e-data-cal-view.h:
- * libedata-cal/e-data-cal.c: (e_data_cal_notify_object_removed):
- * libedata-cal/e-data-cal.h: Changed the API's to use the
- ECalComponentId structure instead of uid.
-
2005-10-07 Arunprakash <arunp@novell.com>
* libedata-cal/e-data-cal-factory.c (backend_last_client_gone_cb) :
diff --git a/calendar/backends/contacts/e-cal-backend-contacts.c b/calendar/backends/contacts/e-cal-backend-contacts.c
index 6ca30153b..7453dae06 100644
--- a/calendar/backends/contacts/e-cal-backend-contacts.c
+++ b/calendar/backends/contacts/e-cal-backend-contacts.c
@@ -168,17 +168,15 @@ static void
contact_record_free (ContactRecord *cr)
{
char *comp_str;
- ECalComponentId *id;
+ const char *uid;
g_object_unref (G_OBJECT (cr->contact));
/* Remove the birthday event */
if (cr->comp_birthday) {
comp_str = e_cal_component_get_as_string (cr->comp_birthday);
- id = e_cal_component_get_id (cr->comp_birthday);
- e_cal_backend_notify_object_removed (E_CAL_BACKEND (cr->cbc), id, comp_str, NULL);
-
- e_cal_component_free_id (id);
+ e_cal_component_get_uid (cr->comp_birthday, &uid);
+ e_cal_backend_notify_object_removed (E_CAL_BACKEND (cr->cbc), uid, comp_str, NULL);
g_free (comp_str);
g_object_unref (G_OBJECT (cr->comp_birthday));
}
@@ -186,11 +184,8 @@ contact_record_free (ContactRecord *cr)
/* Remove the anniversary event */
if (cr->comp_anniversary) {
comp_str = e_cal_component_get_as_string (cr->comp_anniversary);
- id = e_cal_component_get_id (cr->comp_birthday);
-
- e_cal_backend_notify_object_removed (E_CAL_BACKEND (cr->cbc), id, comp_str, NULL);
-
- e_cal_component_free_id (id);
+ e_cal_component_get_uid (cr->comp_anniversary, &uid);
+ e_cal_backend_notify_object_removed (E_CAL_BACKEND (cr->cbc), uid, comp_str, NULL);
g_free (comp_str);
g_object_unref (G_OBJECT (cr->comp_anniversary));
}
diff --git a/calendar/backends/file/e-cal-backend-file.c b/calendar/backends/file/e-cal-backend-file.c
index e7a75292d..cdbf37fe9 100644
--- a/calendar/backends/file/e-cal-backend-file.c
+++ b/calendar/backends/file/e-cal-backend-file.c
@@ -689,8 +689,6 @@ notify_removals_cb (gpointer key, gpointer value, gpointer data)
if (!g_hash_table_lookup (context->new_uid_hash, uid)) {
icalcomponent *old_icomp;
gchar *old_obj_str;
- ECalComponent *comp;
- ECalComponentId *id;
/* Object was removed */
@@ -701,15 +699,8 @@ notify_removals_cb (gpointer key, gpointer value, gpointer data)
old_obj_str = icalcomponent_as_ical_string (old_icomp);
if (!old_obj_str)
return;
-
- comp = e_cal_component_new_from_string (old_obj_str);
- id = e_cal_component_get_id (comp);
-
- e_cal_backend_notify_object_removed (context->backend, id, old_obj_str, NULL);
-
- e_cal_component_free_id (id);
- g_object_unref (comp);
+ e_cal_backend_notify_object_removed (context->backend, uid, old_obj_str, NULL);
}
}
@@ -2391,7 +2382,6 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
break;
case ICAL_METHOD_CANCEL:
if (cancel_received_object (cbfile, subcomp)) {
- ECalComponentId *id;
object = (char *) icalcomponent_as_ical_string (subcomp);
obj_data = g_hash_table_lookup (priv->comp_uid_hash, uid);
if (obj_data)
@@ -2399,14 +2389,11 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
else
old_object = NULL;
- id = e_cal_component_get_id (comp);
-
- e_cal_backend_notify_object_removed (E_CAL_BACKEND (backend), id, old_object, object);
+ e_cal_backend_notify_object_removed (E_CAL_BACKEND (backend), uid, old_object, object);
/* remove the component from the toplevel VCALENDAR */
icalcomponent_remove_component (toplevel_comp, subcomp);
icalcomponent_free (subcomp);
- e_cal_component_free_id (id);
g_free (old_object);
}
diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c b/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
index c4cf80c4c..1ddbe4ea8 100644
--- a/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
+++ b/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
@@ -977,6 +977,7 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
}
e_cal_component_set_dtstart (comp, &dt);
+ g_free (t);
}
else
return NULL;
@@ -995,6 +996,7 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
recur_id->type = E_CAL_COMPONENT_RANGE_SINGLE;
recur_id->datetime = dt;
e_cal_component_set_recurid (comp, recur_id);
+
} else {
uid = e_gw_item_get_icalid (item);
@@ -1005,8 +1007,6 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
return NULL;
}
}
-
- g_free (t);
/* classification */
description = e_gw_item_get_classification (item);
@@ -1203,41 +1203,60 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
}
EGwConnectionStatus
-e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *container, ECalComponent *comp, icalproperty_method method, gboolean all_instances, ECalComponent **created_comp, icalparameter_partstat *pstatus)
+e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *container, ECalComponent *comp, icalproperty_method method, gboolean *remove, ECalComponent **created_comp)
{
EGwConnection *cnc;
EGwConnectionStatus status;
icalparameter_partstat partstat;
char *item_id = NULL;
const char *gw_id;
+ gboolean all_instances = FALSE;
+ icalproperty *icalprop;
+ icalcomponent *icalcomp;
const char *recurrence_key = NULL;
- gboolean need_to_get = FALSE;
cnc = e_cal_backend_groupwise_get_connection (cbgw);
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_CONNECTION);
g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
e_cal_component_commit_sequence (comp);
+ /* When the icalcomponent is obtained through the itip message rather
+ * than from the SOAP protocol, the container id has to be explicitly
+ * added to the xgwrecordid inorder to obtain the item id. */
+
+ /* handle recurrences - All */
+ icalcomp = e_cal_component_get_icalcomponent (comp);
+
+ icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
+ while (icalprop) {
+ const char *x_name;
+ x_name = icalproperty_get_x_name (icalprop);
+ if (!strcmp (x_name, "X-GW-RECUR-INSTANCES-MOD-TYPE")) {
+ if (!strcmp (icalproperty_get_x (icalprop), "All"))
+ all_instances = TRUE;
+ if (recurrence_key)
+ break;
+ }
+ if (!strcmp (x_name, "X-GW-RECURRENCE-KEY")) {
+ e_cal_component_get_uid (comp, &recurrence_key);
+ }
+ icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY);
+ }
+
gw_id = e_cal_component_get_gw_id (comp);
switch (e_cal_component_get_vtype (comp)) {
case E_CAL_COMPONENT_EVENT:
- if (!g_str_has_suffix (gw_id, container)) {
+ if (!g_str_has_suffix (gw_id, container))
item_id = g_strconcat (e_cal_component_get_gw_id (comp), GW_EVENT_TYPE_ID, container, NULL);
- need_to_get = TRUE;
-
- }
else
item_id = g_strdup (gw_id);
break;
case E_CAL_COMPONENT_TODO:
- if (!g_str_has_suffix (gw_id, container)) {
+ if (!g_str_has_suffix (gw_id, container))
item_id = g_strconcat (e_cal_component_get_gw_id (comp), GW_TODO_TYPE_ID, container, NULL);
- need_to_get = TRUE;
-
- }
else
item_id = g_strdup (gw_id);
break;
@@ -1245,21 +1264,6 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
return E_GW_CONNECTION_STATUS_INVALID_OBJECT;
}
- if (all_instances)
- e_cal_component_get_uid (comp, &recurrence_key);
-
- /*FIXME - remove this once the server returns us the same iCalid in both interfaces */
-
- if (need_to_get) {
- EGwItem *item = NULL;
-
- status = e_gw_connection_get_item (cnc, container, item_id, "recipients message recipientStatus attachments default", &item);
- if (status == E_GW_CONNECTION_STATUS_OK)
- *created_comp = e_gw_item_to_cal_component (item, cbgw);
-
- g_object_unref (item);
- }
-
switch (method) {
case ICAL_METHOD_REQUEST:
/* get attendee here and add the list along. */
@@ -1297,7 +1301,6 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
status = E_GW_CONNECTION_STATUS_INVALID_OBJECT;
break;
}
- *pstatus = partstat;
switch (partstat) {
ECalComponentTransparency transp;
@@ -1322,6 +1325,7 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
else
status = e_gw_connection_decline_request (cnc, item_id, NULL, NULL);
+ *remove = TRUE;
break;
case ICAL_PARTSTAT_TENTATIVE:
if (all_instances)
@@ -1341,11 +1345,25 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
case ICAL_METHOD_CANCEL:
status = e_gw_connection_retract_request (cnc, item_id, NULL, FALSE, FALSE);
+ *remove = TRUE;
break;
default:
return E_GW_CONNECTION_STATUS_INVALID_OBJECT;
}
+ if (status == E_GW_CONNECTION_STATUS_ITEM_ALREADY_ACCEPTED)
+ return status;
+
+ /*FIXME - handling recurrence items */
+ if (!*remove && status == E_GW_CONNECTION_STATUS_OK) {
+ EGwItem *item = NULL;
+ EGwConnectionStatus stat;
+
+ stat = e_gw_connection_get_item (cnc, container, item_id, "recipients message recipientStatus attachments default", &item);
+ if (stat == E_GW_CONNECTION_STATUS_OK)
+ *created_comp = e_gw_item_to_cal_component (item, cbgw);
+ }
+
return status;
}
diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise-utils.h b/calendar/backends/groupwise/e-cal-backend-groupwise-utils.h
index 2eb4d050f..eacbd5da7 100644
--- a/calendar/backends/groupwise/e-cal-backend-groupwise-utils.h
+++ b/calendar/backends/groupwise/e-cal-backend-groupwise-utils.h
@@ -44,7 +44,7 @@ void e_gw_item_set_changes (EGwItem *item, EGwItem *cached_item);
* Connection-related utility functions
*/
EGwConnectionStatus e_gw_connection_create_appointment (EGwConnection *cnc, const char *container, ECalBackendGroupwise *cbgw, ECalComponent *comp, GSList **id_list);
-EGwConnectionStatus e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *container, ECalComponent *comp, icalproperty_method method, gboolean all_instances, ECalComponent **created_comp, icalparameter_partstat *pstatus);
+EGwConnectionStatus e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *container, ECalComponent *comp, icalproperty_method method, gboolean *remove, ECalComponent **created_comp);
EGwConnectionStatus e_gw_connection_get_freebusy_info (EGwConnection *cnc, GList *users, time_t start, time_t end, GList **freebusy, icaltimezone *default_zone);
void e_cal_backend_groupwise_store_settings (EGwSendOptions *opts, ECalBackendGroupwise *cbgw);
EGwItem * e_gw_item_new_for_delegate_from_cal (ECalBackendGroupwise *cbgw, ECalComponent *comp);
diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise.c b/calendar/backends/groupwise/e-cal-backend-groupwise.c
index 6a0b021f4..10d027c9e 100644
--- a/calendar/backends/groupwise/e-cal-backend-groupwise.c
+++ b/calendar/backends/groupwise/e-cal-backend-groupwise.c
@@ -1942,19 +1942,21 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend, EDataCal *cal,
ECalBackendSyncStatus status;
const char *id_to_remove = NULL;
icalcomponent *icalcomp;
-
- status = e_cal_backend_groupwise_get_object (backend, cal, uid, rid, &calobj);
- if (status != GNOME_Evolution_Calendar_Success)
- return status;
- g_message ("object found \n");
-
- icalcomp = icalparser_parse_string (calobj);
- if (!icalcomp) {
- g_free (calobj);
- return GNOME_Evolution_Calendar_InvalidObject;
- }
if (mod == CALOBJ_MOD_THIS) {
+
+ status = e_cal_backend_groupwise_get_object (backend, cal, uid, rid, &calobj);
+ if (status != GNOME_Evolution_Calendar_Success)
+ return status;
+
+ *old_object = strdup (calobj);
+
+ icalcomp = icalparser_parse_string (calobj);
+ if (!icalcomp) {
+ g_free (calobj);
+ return GNOME_Evolution_Calendar_InvalidObject;
+ }
+
id_to_remove = get_gw_item_id (icalcomp);
if (!id_to_remove) {
/* use the iCalId to remove the object */
@@ -1975,7 +1977,6 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend, EDataCal *cal,
return GNOME_Evolution_Calendar_ObjectNotFound;
}
*object = NULL;
- *old_object = strdup (calobj);
g_free (calobj);
return GNOME_Evolution_Calendar_Success;
} else {
@@ -1995,7 +1996,6 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend, EDataCal *cal,
status = e_gw_connection_decline_request (priv->cnc, id_to_remove, NULL, uid);
} else {
GList *item_ids = NULL;
-
for (l = comp_list; l; l = l->next) {
ECalComponent *comp = E_CAL_COMPONENT (l->data);
@@ -2012,26 +2012,18 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend, EDataCal *cal,
for (l = comp_list; l; l = l->next) {
ECalComponent *comp = E_CAL_COMPONENT (l->data);
- ECalComponentId *id = e_cal_component_get_id (comp);
-
- e_cal_backend_cache_remove_component (priv->cache, id->uid,
- id->rid);
- if (!g_str_equal (id->rid, rid))
- e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgw), id, e_cal_component_get_as_string (comp), NULL);
- e_cal_component_free_id (id);
-
+ e_cal_backend_cache_remove_component (priv->cache, uid,
+ e_cal_component_get_recurid_as_string (comp));
+ e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgw),
+ uid, e_cal_component_get_as_string (comp), NULL);
g_object_unref (comp);
}
/* Setting NULL would trigger another signal.
* We do not set the *object to NULL */
g_slist_free (comp_list);
- *old_object = strdup (calobj);
- *object = NULL;
- g_free (calobj);
return GNOME_Evolution_Calendar_Success;
} else {
- g_free (calobj);
return GNOME_Evolution_Calendar_OtherError;
}
} else
@@ -2118,54 +2110,6 @@ fetch_attachments (ECalBackendGroupwise *cbgw, ECalComponent *comp)
e_cal_component_set_attachment_list (comp, new_attach_list);
}
-static void
-change_status (ECalComponent *comp, icalparameter_partstat status, const char *email)
-{
- icalproperty *prop;
- icalparameter *param;
- gboolean found = FALSE;
- icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
-
-
- for (prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY);
- prop;
- prop = icalcomponent_get_next_property (icalcomp, ICAL_ATTENDEE_PROPERTY)) {
- const char *attendee = icalproperty_get_attendee (prop);
-
- if (!g_strncasecmp (attendee, "mailto:", 7))
- attendee += 7;
-
- if (!g_ascii_strcasecmp (attendee, email)) {
- found = TRUE;
- param = icalparameter_new_partstat (status);
- icalproperty_set_parameter (prop, param);
- break;
- }
- }
-
- /* We couldn find the attendee in the component, so add a new attendee */
- if (!found) {
- char *temp = g_strdup_printf ("MAILTO:%s", email);
-
- prop = icalproperty_new_attendee ((const char *) temp);
- icalcomponent_add_property (icalcomp, prop);
-
- param = icalparameter_new_partstat (ICAL_PARTSTAT_DELEGATED);
- icalproperty_add_parameter (prop, param);
-
- param = icalparameter_new_role (ICAL_ROLE_NONPARTICIPANT);
- icalproperty_add_parameter (prop, param);
-
- param = icalparameter_new_cutype (ICAL_CUTYPE_INDIVIDUAL);
- icalproperty_add_parameter (prop, param);
-
- param = icalparameter_new_rsvp (ICAL_RSVP_TRUE);
- icalproperty_add_parameter (prop, param);
-
- g_free (temp);
- }
-}
-
static ECalBackendSyncStatus
receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalcomp)
{
@@ -2173,31 +2117,10 @@ receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalco
ECalBackendGroupwisePrivate *priv;
icalproperty_method method;
EGwConnectionStatus status;
- gboolean all_instances = FALSE;
- icalparameter_partstat pstatus;
- icalproperty *icalprop;
+ gboolean remove = FALSE;
priv = cbgw->priv;
- /* When the icalcomponent is obtained through the itip message rather
- * than from the SOAP protocol, the container id has to be explicitly
- * added to the xgwrecordid inorder to obtain the item id. */
- icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
- while (icalprop) {
- const char *x_name;
-
- x_name = icalproperty_get_x_name (icalprop);
- if (!strcmp (x_name, "X-GW-RECUR-INSTANCES-MOD-TYPE")) {
- if (!strcmp (icalproperty_get_x (icalprop), "All")) {
- all_instances = TRUE;
- icalcomponent_remove_property (icalcomp, icalprop);
- break;
- }
- }
-
- icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY);
- }
-
comp = e_cal_component_new ();
e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));
method = icalcomponent_get_method (icalcomp);
@@ -2206,80 +2129,56 @@ receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalco
if (e_cal_component_has_attachments (comp))
fetch_attachments (cbgw, comp);
- status = e_gw_connection_send_appointment (cbgw, priv->container_id, comp, method, all_instances, &modif_comp, &pstatus);
+ status = e_gw_connection_send_appointment (cbgw, priv->container_id, comp, method, &remove, &modif_comp);
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
- status = e_gw_connection_send_appointment (cbgw, priv->container_id, comp, method, all_instances, &modif_comp, &pstatus);
+ status = e_gw_connection_send_appointment (cbgw, priv->container_id, comp, method, &remove, &modif_comp);
- if (!modif_comp)
- modif_comp = g_object_ref (comp);
+ if (status == E_GW_CONNECTION_STATUS_ITEM_ALREADY_ACCEPTED) {
+ g_object_unref (comp);
+ return GNOME_Evolution_Calendar_Success;
+ }
/* update the cache */
- if (status == E_GW_CONNECTION_STATUS_OK || status == E_GW_CONNECTION_STATUS_ITEM_ALREADY_ACCEPTED) {
- GSList *comps = NULL, *l;
- gboolean found = FALSE;
-
- if (all_instances) {
+ if (status == E_GW_CONNECTION_STATUS_OK) {
+ if (remove) {
const char *uid;
-
- e_cal_component_get_uid (modif_comp, (const char **) &uid);
- comps = e_cal_backend_cache_get_components_by_uid (priv->cache, uid);
-
- if (!comps)
- comps = g_slist_append (comps, g_object_ref (modif_comp));
- else
- found = TRUE;
- } else {
- ECalComponentId *id = e_cal_component_get_id (modif_comp);
- ECalComponent *comp = NULL;
-
- comp = e_cal_backend_cache_get_component (priv->cache, id->uid, id->rid);
-
- if (!comp)
- comps = g_slist_append (comps, g_object_ref (modif_comp));
- else {
- comps = g_slist_append (comps, comp);
- found = TRUE;
- }
-
- e_cal_component_free_id (id);
+
+ e_cal_component_get_uid (comp, (const char **) &uid);
+ if (e_cal_backend_cache_remove_component (priv->cache, uid, NULL))
+ e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgw), uid, e_cal_component_get_as_string (comp), NULL);
}
-
- for (l = comps; l != NULL; l = l->next) {
- ECalComponent *comp = E_CAL_COMPONENT (l->data);
-
- if (pstatus == ICAL_PARTSTAT_DECLINED) {
- ECalComponentId *id = e_cal_component_get_id (comp);
-
- if (e_cal_backend_cache_remove_component (priv->cache, id->uid, id->rid)) {
-
- e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgw), id, e_cal_component_get_as_string (comp), NULL);
- e_cal_component_free_id (id);
+ else {
+ char *cache_comp = NULL, *uid, *new_comp = NULL;
+ ECalComponent *cache_component;
+
+ if (!modif_comp)
+ modif_comp = g_object_ref (comp);
+ else
+ e_cal_component_commit_sequence (modif_comp);
- }
+ e_cal_component_get_uid (modif_comp, (const char **) &uid);
+ cache_component = e_cal_backend_cache_get_component (priv->cache, uid, NULL);
+
+ if (cache_component) {
+ e_cal_component_commit_sequence (cache_component);
+ cache_comp = e_cal_component_get_as_string (cache_component);
+ }
- } else {
- char *comp_str = NULL;
+ e_cal_backend_cache_put_component (priv->cache, modif_comp);
+ new_comp = e_cal_component_get_as_string (modif_comp);
- change_status (comp, pstatus, e_gw_connection_get_user_email (priv->cnc));
- e_cal_backend_cache_put_component (priv->cache, comp);
- comp_str = e_cal_component_get_as_string (comp);
+ if (cache_comp)
+ e_cal_backend_notify_object_modified (E_CAL_BACKEND (cbgw), cache_comp, new_comp);
+ else
+ e_cal_backend_notify_object_created (E_CAL_BACKEND (cbgw), new_comp);
- if (found)
- e_cal_backend_notify_object_modified (E_CAL_BACKEND (cbgw), comp_str, comp_str);
- else
- e_cal_backend_notify_object_created (E_CAL_BACKEND (cbgw), comp_str);
-
- g_free (comp_str);
- }
- }
-
- g_slist_foreach (comps, (GFunc) g_object_unref, NULL);
- g_slist_free (comps);
+ g_free (cache_comp);
+ g_free (new_comp);
+ g_object_unref (modif_comp);
+ }
g_object_unref (comp);
- g_object_unref (modif_comp);
- return GNOME_Evolution_Calendar_Success;
-
+ return GNOME_Evolution_Calendar_Success;
}
if (status == E_GW_CONNECTION_STATUS_INVALID_OBJECT) {
diff --git a/calendar/backends/http/e-cal-backend-http.c b/calendar/backends/http/e-cal-backend-http.c
index 16b1fdb80..1fad363ae 100644
--- a/calendar/backends/http/e-cal-backend-http.c
+++ b/calendar/backends/http/e-cal-backend-http.c
@@ -200,13 +200,8 @@ notify_and_remove_from_cache (gpointer key, gpointer value, gpointer user_data)
const char *uid = key;
const char *calobj = value;
ECalBackendHttp *cbhttp = E_CAL_BACKEND_HTTP (user_data);
- ECalComponent *comp = e_cal_component_new_from_string (calobj);
- ECalComponentId *id = e_cal_component_get_id (comp);
- e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbhttp), id, calobj, NULL);
-
- e_cal_component_free_id (comp);
- g_object_unref (comp);
+ e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbhttp), uid, calobj, NULL);
return TRUE;
}
diff --git a/calendar/backends/weather/e-cal-backend-weather.c b/calendar/backends/weather/e-cal-backend-weather.c
index 1e61ae157..5ab16e735 100644
--- a/calendar/backends/weather/e-cal-backend-weather.c
+++ b/calendar/backends/weather/e-cal-backend-weather.c
@@ -145,14 +145,10 @@ finished_retrieval_cb (GList *forecasts, ECalBackendWeather *cbw)
l = e_cal_backend_cache_get_components (priv->cache);
for (; l != NULL; l = g_list_next (l)) {
icomp = e_cal_component_get_icalcomponent (E_CAL_COMPONENT (l->data));
- ECalComponentId *id = e_cal_component_get_id (E_CAL_COMPONENT (l->data));
-
e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbw),
- id,
+ icalcomponent_get_uid (icomp),
icalcomponent_as_ical_string (icomp),
NULL);
-
- e_cal_component_free_id (id);
g_object_unref (G_OBJECT (l->data));
}
g_list_free (l);
diff --git a/calendar/idl/Evolution-DataServer-Calendar.idl b/calendar/idl/Evolution-DataServer-Calendar.idl
index 14741dd19..b9fb4e39e 100644
--- a/calendar/idl/Evolution-DataServer-Calendar.idl
+++ b/calendar/idl/Evolution-DataServer-Calendar.idl
@@ -28,7 +28,7 @@ module Calendar {
/* A unique identifier for a calendar component */
typedef string CalObjUID;
- /* A unique identifier for an event recurrence */
+ /* A unique identified for an event recurrence */
typedef string CalRecurID;
/* Simple sequence of strings */
@@ -37,15 +37,6 @@ module Calendar {
/* Sequence of unique identifiers */
typedef sequence<CalObjUID> CalObjUIDSeq;
- /* A unique identifier and the recurrence id for calendar components */
- struct CalObjID {
- CalObjUID uid;
- CalRecurID rid;
- };
-
- /* sequence of ids of calendar components */
- typedef sequence<CalObjID> CalObjIDSeq;
-
/* A VTIMEZONE component, represented as an iCalendar string. */
typedef string CalTimezoneObj;
@@ -154,7 +145,7 @@ module Calendar {
interface CalViewListener : Bonobo::Unknown {
oneway void notifyObjectsAdded (in stringlist objects);
oneway void notifyObjectsModified (in stringlist objects);
- oneway void notifyObjectsRemoved (in CalObjIDSeq ids);
+ oneway void notifyObjectsRemoved (in CalObjUIDSeq uids);
oneway void notifyQueryProgress (in string message, in short percent);
oneway void notifyQueryDone (in CallStatus status);
};
diff --git a/calendar/libecal/e-cal-component.c b/calendar/libecal/e-cal-component.c
index 85bffce34..03467abd1 100644
--- a/calendar/libecal/e-cal-component.c
+++ b/calendar/libecal/e-cal-component.c
@@ -1136,6 +1136,7 @@ e_cal_component_get_icalcomponent (ECalComponent *comp)
g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), NULL);
priv = comp->priv;
+ g_return_val_if_fail (priv->need_sequence_inc == FALSE, NULL);
return priv->icalcomp;
}
@@ -1418,31 +1419,6 @@ e_cal_component_abort_sequence (ECalComponent *comp)
}
/**
- * e_cal_component_get_id:
- * @comp: A calendar component object.
- *
- * Return value: the id of the component
- * */
-ECalComponentId *
-e_cal_component_get_id (ECalComponent *comp)
-{
- ECalComponentPrivate *priv;
- ECalComponentId *id = NULL;
-
- g_return_if_fail (comp != NULL);
- g_return_if_fail (E_IS_CAL_COMPONENT (comp));
-
- priv = comp->priv;
- g_return_if_fail (priv->icalcomp != NULL);
-
- id = g_new0 (ECalComponentId, 1);
- id->uid = g_strdup (icalproperty_get_uid (priv->uid));
- id->rid = g_strdup (e_cal_component_get_recurid_as_string (comp));
-
- return id;
-}
-
-/**
* e_cal_component_get_uid:
* @comp: A calendar component object.
* @uid: Return value for the UID string.
@@ -4869,30 +4845,6 @@ e_cal_component_free_sequence (int *sequence)
}
/**
- * e_cal_component_free_id:
- * @id Component Id.
- *
- * Frees the id.
- **/
-void
-e_cal_component_free_id (ECalComponentId *id)
-{
- g_return_if_fail (id != NULL);
-
- if (id->uid) {
- g_free (id->uid);
- id->uid = NULL;
- }
-
- if (id->rid) {
- g_free (id->rid);
- id->rid = NULL;
- }
-
- g_free (id);
-}
-
-/**
* e_cal_component_free_text_list:
* @text_list: List of #ECalComponentText structures.
*
diff --git a/calendar/libecal/e-cal-component.h b/calendar/libecal/e-cal-component.h
index 31ebc7af9..ca545fc68 100644
--- a/calendar/libecal/e-cal-component.h
+++ b/calendar/libecal/e-cal-component.h
@@ -38,11 +38,6 @@ G_BEGIN_DECLS
#define E_IS_CAL_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CAL_COMPONENT))
#define E_IS_CAL_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CAL_COMPONENT))
-typedef struct {
- char *uid;
- char *rid;
-} ECalComponentId;
-
/* Types of calendar components to be stored by a ECalComponent, as per RFC 2445.
* We don't put the alarm component type here since we store alarms as separate
* structures inside the other "real" components.
@@ -226,9 +221,6 @@ void e_cal_component_abort_sequence (ECalComponent *comp);
void e_cal_component_get_uid (ECalComponent *comp, const char **uid);
void e_cal_component_set_uid (ECalComponent *comp, const char *uid);
-ECalComponentId *e_cal_component_get_id (ECalComponent *comp);
-void e_cal_component_free_id (ECalComponentId *id);
-
void e_cal_component_get_categories (ECalComponent *comp, const char **categories);
void e_cal_component_set_categories (ECalComponent *comp, const char *categories);
void e_cal_component_get_categories_list (ECalComponent *comp, GSList **categ_list);
diff --git a/calendar/libecal/e-cal-view-listener.c b/calendar/libecal/e-cal-view-listener.c
index bce8e78c1..e960f1c3a 100644
--- a/calendar/libecal/e-cal-view-listener.c
+++ b/calendar/libecal/e-cal-view-listener.c
@@ -97,24 +97,14 @@ build_object_list (const GNOME_Evolution_Calendar_stringlist *seq)
}
static GList *
-build_id_list (const GNOME_Evolution_Calendar_CalObjUIDSeq *seq)
+build_uid_list (const GNOME_Evolution_Calendar_CalObjUIDSeq *seq)
{
GList *list;
int i;
list = NULL;
- for (i = 0; i < seq->_length; i++) {
- GNOME_Evolution_Calendar_CalObjID *corba_id;
- ECalComponentId *id;
-
- corba_id = &seq->_buffer[i];
- id = g_new (ECalComponentId, 1);
-
- id->uid = g_strdup (corba_id->uid);
- id->rid = g_strdup (corba_id->rid);
-
- list = g_list_prepend (list, id);
- }
+ for (i = 0; i < seq->_length; i++)
+ list = g_list_prepend (list, g_strdup (seq->_buffer[i]));
return list;
}
@@ -163,23 +153,23 @@ impl_notifyObjectsModified (PortableServer_Servant servant,
static void
impl_notifyObjectsRemoved (PortableServer_Servant servant,
- const GNOME_Evolution_Calendar_CalObjIDSeq *ids,
+ const GNOME_Evolution_Calendar_CalObjUIDSeq *uids,
CORBA_Environment *ev)
{
ECalViewListener *ql;
ECalViewListenerPrivate *priv;
- GList *id_list, *l;
+ GList *uid_list, *l;
ql = E_CAL_VIEW_LISTENER (bonobo_object_from_servant (servant));
priv = ql->priv;
- id_list = build_id_list (ids);
+ uid_list = build_uid_list (uids);
- g_signal_emit (G_OBJECT (ql), signals[OBJECTS_REMOVED], 0, id_list);
+ g_signal_emit (G_OBJECT (ql), signals[OBJECTS_REMOVED], 0, uid_list);
- for (l = id_list; l; l = l->next)
- e_cal_component_free_id (l->data);
- g_list_free (id_list);
+ for (l = uid_list; l; l = l->next)
+ g_free (l->data);
+ g_list_free (uid_list);
}
static void
diff --git a/calendar/libecal/e-cal-view.c b/calendar/libecal/e-cal-view.c
index 3aece8ea5..680d6b710 100644
--- a/calendar/libecal/e-cal-view.c
+++ b/calendar/libecal/e-cal-view.c
@@ -92,14 +92,14 @@ objects_modified_cb (ECalViewListener *listener, GList *objects, gpointer data)
}
static void
-objects_removed_cb (ECalViewListener *listener, GList *ids, gpointer data)
+objects_removed_cb (ECalViewListener *listener, GList *uids, gpointer data)
{
ECalView *view;
view = E_CAL_VIEW (data);
g_object_ref (view);
- g_signal_emit (G_OBJECT (view), signals[OBJECTS_REMOVED], 0, ids);
+ g_signal_emit (G_OBJECT (view), signals[OBJECTS_REMOVED], 0, uids);
g_object_unref (view);
}
diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index f6dafb273..1d0547a69 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -3912,7 +3912,7 @@ e_cal_free_alarms (GSList *comp_alarms)
* Return value: TRUE on success, FALSE if the object was not found.
**/
gboolean
-e_cal_get_alarms_for_object (ECal *ecal, const ECalComponentId *id,
+e_cal_get_alarms_for_object (ECal *ecal, const char *uid,
time_t start, time_t end,
ECalComponentAlarms **alarms)
{
@@ -3927,14 +3927,14 @@ e_cal_get_alarms_for_object (ECal *ecal, const ECalComponentId *id,
priv = ecal->priv;
g_return_val_if_fail (priv->load_state == E_CAL_LOAD_LOADED, FALSE);
- g_return_val_if_fail (id != NULL, FALSE);
+ g_return_val_if_fail (uid != NULL, FALSE);
g_return_val_if_fail (start >= 0 && end >= 0, FALSE);
g_return_val_if_fail (start <= end, FALSE);
g_return_val_if_fail (alarms != NULL, FALSE);
*alarms = NULL;
- if (!e_cal_get_object (ecal, id->uid, id->rid, &icalcomp, NULL))
+ if (!e_cal_get_object (ecal, uid, NULL, &icalcomp, NULL))
return FALSE;
if (!icalcomp)
return FALSE;
diff --git a/calendar/libecal/e-cal.h b/calendar/libecal/e-cal.h
index 876c91f92..10c7f77bb 100644
--- a/calendar/libecal/e-cal.h
+++ b/calendar/libecal/e-cal.h
@@ -165,7 +165,7 @@ GSList *e_cal_get_alarms_in_range (ECal *ecal, time_t start, time_t end);
void e_cal_free_alarms (GSList *comp_alarms);
-gboolean e_cal_get_alarms_for_object (ECal *ecal, const ECalComponentId *id,
+gboolean e_cal_get_alarms_for_object (ECal *ecal, const char *uid,
time_t start, time_t end,
ECalComponentAlarms **alarms);
diff --git a/calendar/libedata-cal/e-cal-backend-sync.c b/calendar/libedata-cal/e-cal-backend-sync.c
index d400e27fe..b4f85d966 100644
--- a/calendar/libedata-cal/e-cal-backend-sync.c
+++ b/calendar/libedata-cal/e-cal-backend-sync.c
@@ -723,20 +723,10 @@ _e_cal_backend_remove_object (ECalBackend *backend, EDataCal *cal, const char *u
== GNOME_Evolution_Calendar_Success) {
e_data_cal_notify_object_modified (cal, status, old_object, calobj);
g_free (calobj);
- } else {
- ECalComponentId *id = g_new0 (ECalComponentId, 1);
- id->uid = g_strdup (uid);
-
- if (mod == CALOBJ_MOD_THIS)
- id->rid = g_strdup (rid);
-
- e_data_cal_notify_object_removed (cal, status, id, old_object, object);
-
- e_cal_component_free_id (id);
-
- }
+ } else
+ e_data_cal_notify_object_removed (cal, status, uid, old_object, object);
} else
- e_data_cal_notify_object_removed (cal, status, NULL, old_object, object);
+ e_data_cal_notify_object_removed (cal, status, uid, old_object, object);
g_free (object);
}
diff --git a/calendar/libedata-cal/e-cal-backend.c b/calendar/libedata-cal/e-cal-backend.c
index 3d65832ee..b2ddd8c1d 100644
--- a/calendar/libedata-cal/e-cal-backend.c
+++ b/calendar/libedata-cal/e-cal-backend.c
@@ -1130,27 +1130,21 @@ e_cal_backend_notify_object_created (ECalBackend *backend, const char *calobj)
static void
match_query_and_notify (EDataCalView *query, const char *old_object, const char *object)
{
- gboolean old_match = FALSE, new_match = FALSE;
-
- if (old_object)
- old_match = e_data_cal_view_object_matches (query, old_object);
+ gboolean old_match, new_match;
+ old_match = e_data_cal_view_object_matches (query, old_object);
new_match = e_data_cal_view_object_matches (query, object);
if (old_match && new_match)
e_data_cal_view_notify_objects_modified_1 (query, object);
else if (new_match)
e_data_cal_view_notify_objects_added_1 (query, object);
else if (old_match) {
- ECalComponent *comp = NULL;
+ icalcomponent *icalcomp;
- comp = e_cal_component_new_from_string (old_object);
- if (comp) {
- ECalComponentId *id = e_cal_component_get_id (comp);
-
- e_data_cal_view_notify_objects_removed_1 (query, id);
-
- e_cal_component_free_id (id);
- g_object_unref (comp);
+ icalcomp = icalcomponent_new_from_string ((char *) old_object);
+ if (icalcomp) {
+ e_data_cal_view_notify_objects_removed_1 (query, icalcomponent_get_uid (icalcomp));
+ icalcomponent_free (icalcomp);
}
}
}
@@ -1280,7 +1274,7 @@ e_cal_backend_notify_object_modified (ECalBackend *backend,
/**
* e_cal_backend_notify_object_removed:
* @backend: A calendar backend.
- * @id: the Id of the removed object
+ * @uid: the UID of the removed object
* @old_object: iCalendar representation of the removed object
* @new_object: iCalendar representation of the object after the removal. This
* only applies to recurrent appointments that had an instance removed. In that
@@ -1293,7 +1287,7 @@ e_cal_backend_notify_object_modified (ECalBackend *backend,
* removed by non-EDS clients.
**/
void
-e_cal_backend_notify_object_removed (ECalBackend *backend, const ECalComponentId *id,
+e_cal_backend_notify_object_removed (ECalBackend *backend, const char *uid,
const char *old_object, const char *object)
{
ECalBackendPrivate *priv;
@@ -1304,7 +1298,7 @@ e_cal_backend_notify_object_removed (ECalBackend *backend, const ECalComponentId
priv = backend->priv;
if (priv->notification_proxy) {
- e_cal_backend_notify_object_removed (priv->notification_proxy, id, old_object, object);
+ e_cal_backend_notify_object_removed (priv->notification_proxy, uid, old_object, object);
return;
}
@@ -1320,7 +1314,7 @@ e_cal_backend_notify_object_removed (ECalBackend *backend, const ECalComponentId
/* if object == NULL, it means the object has been completely
removed from the backend */
if (e_data_cal_view_object_matches (query, old_object))
- e_data_cal_view_notify_objects_removed_1 (query, id);
+ e_data_cal_view_notify_objects_removed_1 (query, uid);
} else
match_query_and_notify (query, old_object, object);
diff --git a/calendar/libedata-cal/e-cal-backend.h b/calendar/libedata-cal/e-cal-backend.h
index f83de05f9..c97bf8c88 100644
--- a/calendar/libedata-cal/e-cal-backend.h
+++ b/calendar/libedata-cal/e-cal-backend.h
@@ -169,7 +169,7 @@ void e_cal_backend_last_client_gone (ECalBackend *backend);
void e_cal_backend_set_notification_proxy (ECalBackend *backend, ECalBackend *proxy);
void e_cal_backend_notify_object_created (ECalBackend *backend, const char *calobj);
void e_cal_backend_notify_object_modified (ECalBackend *backend, const char *old_object, const char *object);
-void e_cal_backend_notify_object_removed (ECalBackend *backend, const ECalComponentId *id, const char *old_object, const char *object);
+void e_cal_backend_notify_object_removed (ECalBackend *backend, const char *uid, const char *old_object, const char *object);
void e_cal_backend_notify_mode (ECalBackend *backend,
GNOME_Evolution_Calendar_CalListener_SetModeStatus status,
diff --git a/calendar/libedata-cal/e-data-cal-view.c b/calendar/libedata-cal/e-data-cal-view.c
index 3f972a3d8..d6ccc2c61 100644
--- a/calendar/libedata-cal/e-data-cal-view.c
+++ b/calendar/libedata-cal/e-data-cal-view.c
@@ -117,44 +117,37 @@ add_object_to_cache (EDataCalView *query, const char *calobj)
}
static gboolean
-uncache_with_id_cb (gpointer key, gpointer value, gpointer user_data)
+uncache_with_uid_cb (gpointer key, gpointer value, gpointer user_data)
{
ECalComponent *comp;
- ECalComponentId *id;
const char *this_uid;
- char *object;
- gboolean remove = FALSE;
+ char *uid, *object;
- id = user_data;
+ uid = user_data;
object = value;
comp = e_cal_component_new_from_string (object);
if (comp) {
e_cal_component_get_uid (comp, &this_uid);
- if (this_uid && !strcmp (id->uid, this_uid)) {
- if (id->rid && *id->rid) {
- const char *rid = e_cal_component_get_recurid_as_string (comp);
-
- if (rid && !strcmp (id->rid, rid))
- remove = TRUE;
- } else
- remove = TRUE;
+ if (this_uid && *this_uid && !strcmp (uid, this_uid)) {
+ g_object_unref (comp);
+ return TRUE;
}
g_object_unref (comp);
}
- return remove;
+ return FALSE;
}
static void
-remove_object_from_cache (EDataCalView *query, const ECalComponentId *id)
+remove_object_from_cache (EDataCalView *query, const char *uid)
{
EDataCalViewPrivate *priv;
priv = query->priv;
- g_hash_table_foreach_remove (priv->matched_objects, (GHRFunc) uncache_with_id_cb, (gpointer) id);
+ g_hash_table_foreach_remove (priv->matched_objects, (GHRFunc) uncache_with_uid_cb, (gpointer) uid);
}
static void
@@ -773,18 +766,18 @@ e_data_cal_view_notify_objects_modified_1 (EDataCalView *query, const char *obje
/**
* e_data_cal_view_notify_objects_removed:
* @query: A query object.
- * @ids: List of IDs for the objects that have been removed.
+ * @uids: List of UIDs for the objects that have been removed.
*
* Notifies all query listener of the removal of a list of objects.
*/
void
-e_data_cal_view_notify_objects_removed (EDataCalView *query, const GList *ids)
+e_data_cal_view_notify_objects_removed (EDataCalView *query, const GList *uids)
{
EDataCalViewPrivate *priv;
- GNOME_Evolution_Calendar_CalObjIDSeq id_list;
+ GNOME_Evolution_Calendar_CalObjUIDSeq uid_list;
CORBA_Environment ev;
const GList *l;
- int num_ids, i;
+ int num_uids, i;
g_return_if_fail (query != NULL);
g_return_if_fail (IS_QUERY (query));
@@ -792,69 +785,60 @@ e_data_cal_view_notify_objects_removed (EDataCalView *query, const GList *ids)
priv = query->priv;
g_return_if_fail (priv->listeners != CORBA_OBJECT_NIL);
- num_ids = g_list_length ((GList*)ids);
- if (num_ids <= 0)
+ num_uids = g_list_length ((GList*)uids);
+ if (num_uids <= 0)
return;
-
- id_list._buffer = GNOME_Evolution_Calendar_CalObjIDSeq_allocbuf (num_ids);
- id_list._maximum = num_ids;
- id_list._length = num_ids;
-
- i = 0;
- for (l = ids; l; l = l->next, i++) {
- ECalComponentId *id = l->data;
- GNOME_Evolution_Calendar_CalObjID *c_id = &id_list._buffer[i];
-
- c_id->uid = CORBA_string_dup (id->uid);
-
- if (id->rid)
- c_id->rid = CORBA_string_dup (id->rid);
- else
- c_id->rid = CORBA_string_dup ("");
+
+ uid_list._buffer = GNOME_Evolution_Calendar_CalObjUIDSeq_allocbuf (num_uids);
+ uid_list._maximum = num_uids;
+ uid_list._length = num_uids;
+
+ for (l = uids, i = 0; l; l = l->next, i ++) {
+ uid_list._buffer[i] = CORBA_string_dup (l->data);
/* update our cache */
remove_object_from_cache (query, l->data);
}
-
+
for (l = priv->listeners; l != NULL; l = l->next) {
ListenerData *ld = l->data;
CORBA_exception_init (&ev);
- GNOME_Evolution_Calendar_CalViewListener_notifyObjectsRemoved (ld->listener, &id_list, &ev);
+ GNOME_Evolution_Calendar_CalViewListener_notifyObjectsRemoved (ld->listener, &uid_list, &ev);
if (BONOBO_EX (&ev))
g_warning (G_STRLOC ": could not notify the listener of object removal");
CORBA_exception_free (&ev);
}
- CORBA_free (id_list._buffer);
+ CORBA_free (uid_list._buffer);
}
/**
* e_data_cal_view_notify_objects_removed:
* @query: A query object.
- * @id: Id of the removed object.
+ * @uid: UID of the removed object.
*
* Notifies all query listener of the removal of a single object.
*/
void
-e_data_cal_view_notify_objects_removed_1 (EDataCalView *query, const ECalComponentId *id)
+e_data_cal_view_notify_objects_removed_1 (EDataCalView *query, const char *uid)
{
EDataCalViewPrivate *priv;
- GList ids;
+ GList uids;
g_return_if_fail (query != NULL);
g_return_if_fail (IS_QUERY (query));
- g_return_if_fail (id != NULL);
+ g_return_if_fail (uid != NULL);
priv = query->priv;
g_return_if_fail (priv->listeners != CORBA_OBJECT_NIL);
- ids.next = ids.prev = NULL;
- ids.data = (gpointer)id;
+ uids.next = uids.prev = NULL;
+ uids.data = (gpointer)uid;
- e_data_cal_view_notify_objects_removed (query, &ids);
+ e_data_cal_view_notify_objects_removed (query, &uids);
}
/**
diff --git a/calendar/libedata-cal/e-data-cal-view.h b/calendar/libedata-cal/e-data-cal-view.h
index 9ac6b64a2..195d0e217 100644
--- a/calendar/libedata-cal/e-data-cal-view.h
+++ b/calendar/libedata-cal/e-data-cal-view.h
@@ -74,9 +74,9 @@ void e_data_cal_view_notify_objects_modified (EDataCalView
void e_data_cal_view_notify_objects_modified_1 (EDataCalView *query,
const char *object);
void e_data_cal_view_notify_objects_removed (EDataCalView *query,
- const GList *ids);
+ const GList *uids);
void e_data_cal_view_notify_objects_removed_1 (EDataCalView *query,
- const ECalComponentId *id);
+ const char *uid);
void e_data_cal_view_notify_progress (EDataCalView *query,
const char *message,
int percent);
diff --git a/calendar/libedata-cal/e-data-cal.c b/calendar/libedata-cal/e-data-cal.c
index 1b5649fdb..9c70a5347 100644
--- a/calendar/libedata-cal/e-data-cal.c
+++ b/calendar/libedata-cal/e-data-cal.c
@@ -966,7 +966,7 @@ e_data_cal_notify_object_modified (EDataCal *cal, GNOME_Evolution_Calendar_CallS
*/
void
e_data_cal_notify_object_removed (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
- const ECalComponentId *id, const char *old_object, const char *object)
+ const char *uid, const char *old_object, const char *object)
{
EDataCalPrivate *priv;
CORBA_Environment ev;
@@ -978,7 +978,7 @@ e_data_cal_notify_object_removed (EDataCal *cal, GNOME_Evolution_Calendar_CallSt
g_return_if_fail (priv->listener != CORBA_OBJECT_NIL);
if (status == GNOME_Evolution_Calendar_Success)
- e_cal_backend_notify_object_removed (priv->backend, id, old_object, object);
+ e_cal_backend_notify_object_removed (priv->backend, uid, old_object, object);
CORBA_exception_init (&ev);
GNOME_Evolution_Calendar_CalListener_notifyObjectRemoved (priv->listener, status, &ev);
diff --git a/calendar/libedata-cal/e-data-cal.h b/calendar/libedata-cal/e-data-cal.h
index 513229996..3e55aeae7 100644
--- a/calendar/libedata-cal/e-data-cal.h
+++ b/calendar/libedata-cal/e-data-cal.h
@@ -83,7 +83,7 @@ void e_data_cal_notify_object_created (EDataCal *cal, GNOME_Evolution_Calendar_
void e_data_cal_notify_object_modified (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
const char *old_object, const char *object);
void e_data_cal_notify_object_removed (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
- const ECalComponentId *id, const char *old_object, const char *object);
+ const char *uid, const char *old_object, const char *object);
void e_data_cal_notify_alarm_discarded (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status);
void e_data_cal_notify_objects_received (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status);