2004-02-02 Rodrigo Moya <rodrigo@ximian.com>
+ * backends/groupwise/e-cal-backend-groupwise.c (populate_cache):
+ add all retrieved items to the cache, since calendar and tasks
+ both use the same cache file.
+ (e_cal_backend_groupwise_get_object,
+ e_cal_backend_groupwise_get_object_list): only return items of the
+ same kind as the backend.
+ (e_cal_backend_groupwise_create_object): only allow storing of
+ items of the same kind as the backend.
+
+2004-02-02 Rodrigo Moya <rodrigo@ximian.com>
+
* backends/groupwise/e-gw-item.c (e_gw_item_append_to_soap_message):
fixed argument ordering in call to e_gw_message_write_string_parameter.
g_object_unref (item);
if (E_IS_CAL_COMPONENT (comp)) {
e_cal_component_commit_sequence (comp);
- if (e_cal_backend_get_kind (E_CAL_BACKEND (cbgw)) ==
- icalcomponent_isa (e_cal_component_get_icalcomponent (comp))) {
- e_cal_component_get_uid (comp, &uid);
- rid = g_strdup (e_cal_component_get_recurid_as_string (comp));
- e_cal_backend_cache_put_component (priv->cache, comp);
- g_free (rid);
- }
-
+ e_cal_component_get_uid (comp, &uid);
+ rid = g_strdup (e_cal_component_get_recurid_as_string (comp));
+ e_cal_backend_cache_put_component (priv->cache, comp);
+ g_free (rid);
g_object_unref (comp);
}
}
comp = e_cal_backend_cache_get_component (priv->cache, uid, rid);
if (comp) {
g_mutex_unlock (priv->mutex);
- *object = e_cal_component_get_as_string (comp);
+ if (e_cal_backend_get_kind (E_CAL_BACKEND (backend)) ==
+ icalcomponent_isa (e_cal_component_get_icalcomponent (comp)))
+ *object = e_cal_component_get_as_string (comp);
+ else
+ *object = NULL;
+
g_object_unref (comp);
- return GNOME_Evolution_Calendar_Success;
+ return *object ? GNOME_Evolution_Calendar_Success : GNOME_Evolution_Calendar_ObjectNotFound;
}
g_mutex_unlock (priv->mutex);
for (l = components; l != NULL; l = l->next) {
ECalComponent *comp = E_CAL_COMPONENT (l->data);
- if ((!search_needed) ||
- (e_cal_backend_sexp_match_comp (cbsexp, comp, E_CAL_BACKEND (backend)))) {
- *objects = g_list_append (*objects, e_cal_component_get_as_string (comp));
+ if (e_cal_backend_get_kind (E_CAL_BACKEND (backend)) ==
+ icalcomponent_isa (e_cal_component_get_icalcomponent (comp))) {
+ if ((!search_needed) ||
+ (e_cal_backend_sexp_match_comp (cbsexp, comp, E_CAL_BACKEND (backend)))) {
+ *objects = g_list_append (*objects, e_cal_component_get_as_string (comp));
+ }
}
}
if (!icalcomp)
return GNOME_Evolution_Calendar_InvalidObject;
+ if (e_cal_backend_get_kind (E_CAL_BACKEND (backend)) != icalcomponent_isa (icalcomp)) {
+ icalcomponent_free (icalcomp);
+ return GNOME_Evolution_Calendar_InvalidObject;
+ }
+
comp = e_cal_component_new ();
e_cal_component_set_icalcomponent (comp, icalcomp);