}
if (e_cal_backend_store_remove_component (priv->store, id->uid, id->rid)) {
- gchar *old_str = e_cal_component_get_as_string (old_comp);
-
- e_cal_backend_notify_object_removed ((ECalBackend *) cbdav, id, old_str, NULL);
-
- g_free (old_str);
+ e_cal_backend_notify_component_removed ((ECalBackend *) cbdav, id, old_comp, NULL);
}
e_cal_component_free_id (id);
put_component_to_store (cbdav, new_comp);
if (old_comp == NULL) {
- gchar *new_str = e_cal_component_get_as_string (new_comp);
-
- e_cal_backend_notify_object_created (bkend, new_str);
-
- g_free (new_str);
+ e_cal_backend_notify_component_created (bkend, new_comp);
} else {
- gchar *new_str = e_cal_component_get_as_string (new_comp);
- gchar *old_str = e_cal_component_get_as_string (old_comp);
-
- e_cal_backend_notify_object_modified (bkend, old_str, new_str);
-
- g_free (new_str);
- g_free (old_str);
+ e_cal_backend_notify_component_modified (bkend, old_comp, new_comp);
ccl->slist = g_slist_remove (ccl->slist, old_comp);
g_object_unref (old_comp);
return old_comp;
}
+/* the resulting component should be unreffed when done with it;
+ the fallback_comp is cloned, if used */
+static ECalComponent *
+get_ecalcomp_master_from_cache_or_fallback (ECalBackendCalDAV *cbdav,
+ const gchar *uid,
+ const gchar *rid,
+ ECalComponent *fallback_comp)
+{
+ ECalComponent *comp = NULL;
+ icalcomponent *icalcomp;
+
+ g_return_val_if_fail (cbdav != NULL, NULL);
+ g_return_val_if_fail (uid != NULL, NULL);
+
+ icalcomp = get_comp_from_cache (cbdav, uid, rid, NULL, NULL);
+ if (icalcomp) {
+ icalcomponent *master = get_master_comp (cbdav, icalcomp);
+
+ if (master) {
+ comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (master));
+ }
+
+ icalcomponent_free (icalcomp);
+ }
+
+ if (!comp && fallback_comp)
+ comp = e_cal_component_clone (fallback_comp);
+
+ return comp;
+}
+
/* a busy_lock is supposed to be locked already, when calling this function */
static void
do_create_object (ECalBackendCalDAV *cbdav,
const gchar *in_calobj,
gchar **uid,
- icalcomponent **new_component,
+ ECalComponent **new_component,
GError **perror)
{
ECalComponent *comp;
if (uid)
*uid = g_strdup (comp_uid);
- icalcomp = get_comp_from_cache (cbdav, comp_uid, NULL, NULL, NULL);
-
- if (icalcomp) {
- icalcomponent *master = get_master_comp (cbdav, icalcomp);
-
- if (!master)
- *new_component =
- icalcomponent_new_clone (e_cal_component_get_icalcomponent (comp));
- else
- *new_component = icalcomponent_new_clone (master);
-
- icalcomponent_free (icalcomp);
- } else {
- *new_component =
- icalcomponent_new_clone (e_cal_component_get_icalcomponent (comp));
- }
+ if (new_component)
+ *new_component = get_ecalcomp_master_from_cache_or_fallback (cbdav, comp_uid, NULL, comp);
}
g_object_unref (comp);
do_modify_object (ECalBackendCalDAV *cbdav,
const gchar *calobj,
CalObjModType mod,
- icalcomponent **old_component,
- icalcomponent **new_component,
+ ECalComponent **old_component,
+ ECalComponent **new_component,
GError **error)
{
ECalBackendCalDAVPrivate *priv;
/* This will give a reference to 'old_component' */
if (old_instance) {
- *old_component =
- icalcomponent_new_clone (e_cal_component_get_icalcomponent
- (old_instance));
+ *old_component = e_cal_component_clone (old_instance);
g_object_unref (old_instance);
}
}
if (!*old_component) {
icalcomponent *master = get_master_comp (cbdav, cache_comp);
- if (master)
- /* set full component as the old object */
- *old_component = icalcomponent_new_clone (master);
+ if (master) {
+ /* set full component as the old object */
+ *old_component = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (master));
+ }
}
}
/* new object is only this instance */
if (new_component)
- *new_component = icalcomponent_new_clone (new_comp);
+ *new_component = e_cal_component_clone (comp);
/* add the detached instance */
if (icalcomponent_isa (cache_comp) == ICAL_VCALENDAR_COMPONENT) {
if (did_put) {
if (new_component && !*new_component) {
/* read the comp from cache again, as some servers can modify it on put */
- icalcomponent *newcomp = get_comp_from_cache (cbdav, id->uid, NULL, NULL, NULL), *master;
+ *new_component = get_ecalcomp_master_from_cache_or_fallback (cbdav, id->uid, id->rid, NULL);
- if (!newcomp)
- newcomp = cache_comp;
-
- master = get_master_comp (cbdav, newcomp);
-
- if (master)
- *new_component = icalcomponent_new_clone (master);
-
- if (cache_comp != newcomp)
- icalcomponent_free (newcomp);
+ g_warn_if_fail (*new_component != NULL);
}
}
const gchar *uid,
const gchar *rid,
CalObjModType mod,
- icalcomponent **old_component,
- icalcomponent **component,
+ ECalComponent **old_component,
+ ECalComponent **new_component,
GError **perror)
{
ECalBackendCalDAVPrivate *priv;
priv = cbdav->priv;
- if (component)
- *component = NULL;
+ if (new_component)
+ *new_component = NULL;
if (!check_state (cbdav, &online, perror))
return;
ECalComponent *old = e_cal_backend_store_get_component (priv->store, uid, rid);
if (old) {
- *old_component =
- icalcomponent_new_clone (e_cal_component_get_icalcomponent (old));
+ *old_component = e_cal_component_clone (old);
g_object_unref (old);
} else {
icalcomponent *master = get_master_comp (cbdav, cache_comp);
- if (master)
- *old_component = icalcomponent_new_clone (master);
+ if (master) {
+ *old_component = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (master));
+ }
}
}
if (rid && *rid) {
/* remove one instance from the component */
if (remove_instance (cbdav, cache_comp, icaltime_from_string (rid), mod, mod != CALOBJ_MOD_ONLY_THIS)) {
- if (component) {
+ if (new_component) {
icalcomponent *master = get_master_comp (cbdav, cache_comp);
if (master)
- *component = icalcomponent_new_clone (master);
+ *new_component = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (master));
}
} else {
/* this was the last instance, thus delete whole component */
is_declined = e_cal_backend_user_declined (e_cal_component_get_icalcomponent (ecomp));
if (is_in_cache) {
if (!is_declined) {
- icalcomponent *new_component = NULL, *old_component = NULL;
+ ECalComponent *new_component = NULL, *old_component = NULL;
do_modify_object (cbdav, new_obj_str, mod,
&old_component, &new_component, &err);
}
if (new_component)
- icalcomponent_free (new_component);
+ g_object_unref (new_component);
if (old_component)
- icalcomponent_free (old_component);
+ g_object_unref (old_component);
} else {
- icalcomponent *new_component = NULL, *old_component = NULL;
+ ECalComponent *new_component = NULL, *old_component = NULL;
do_remove_object (cbdav, id->uid, id->rid, mod, &old_component, &new_component, &err);
if (!err) {
}
if (new_component)
- icalcomponent_free (new_component);
+ g_object_unref (new_component);
if (old_component)
- icalcomponent_free (old_component);
+ g_object_unref (old_component);
}
} else if (!is_declined) {
- icalcomponent *new_component = NULL;
+ ECalComponent *new_component = NULL;
do_create_object (cbdav, new_obj_str, NULL, &new_component, &err);
}
if (new_component)
- icalcomponent_free (new_component);
+ g_object_unref (new_component);
}
break;
case ICAL_METHOD_CANCEL:
if (is_in_cache) {
- icalcomponent *new_component = NULL, *old_component = NULL;
+ ECalComponent *new_component = NULL, *old_component = NULL;
do_remove_object (cbdav, id->uid, id->rid, CALOBJ_MOD_THIS, &old_component, &new_component, &err);
if (!err) {
}
if (new_component)
- icalcomponent_free (new_component);
+ g_object_unref (new_component);
if (old_component)
- icalcomponent_free (old_component);
+ g_object_unref (old_component);
} else {
err = EDC_ERROR (ObjectNotFound);
}
GCancellable *cancellable,
const gchar *in_calobj,
gchar **uid,
- icalcomponent **new_component,
+ ECalComponent **new_component,
GError **perror),
do_create_object,
(cbdav,
GCancellable *cancellable,
const gchar *calobj,
CalObjModType mod,
- icalcomponent **old_component,
- icalcomponent **new_component,
+ ECalComponent **old_component,
+ ECalComponent **new_component,
GError **perror),
do_modify_object,
(cbdav,
const gchar *uid,
const gchar *rid,
CalObjModType mod,
- icalcomponent **old_component,
- icalcomponent **component,
+ ECalComponent **old_component,
+ ECalComponent **new_component,
GError **perror),
do_remove_object,
(cbdav,
rid,
mod,
old_component,
- component,
+ new_component,
perror))
caldav_busy_stub (
if (!do_search ||
e_cal_backend_sexp_match_comp (sexp, comp, bkend)) {
- gchar *str = e_cal_component_get_as_string (comp);
- e_data_cal_view_notify_objects_added_1 (query, str);
- g_free (str);
+ e_data_cal_view_notify_components_added_1 (query, comp);
}
g_object_unref (comp);
EContact *contact)
{
ContactRecord *cr = g_new0 (ContactRecord, 1);
- gchar *comp_str;
cr->cbc = cbc;
cr->book_client = book_client;
cr->comp_birthday = create_birthday (cbc, contact);
cr->comp_anniversary = create_anniversary (cbc, contact);
- if (cr->comp_birthday) {
- comp_str = e_cal_component_get_as_string (cr->comp_birthday);
- e_cal_backend_notify_object_created (E_CAL_BACKEND (cbc), comp_str);
- g_free (comp_str);
- }
+ if (cr->comp_birthday)
+ e_cal_backend_notify_component_created (E_CAL_BACKEND (cbc), cr->comp_birthday);
- if (cr->comp_anniversary) {
- comp_str = e_cal_component_get_as_string (cr->comp_anniversary);
- e_cal_backend_notify_object_created (E_CAL_BACKEND (cbc), comp_str);
- g_free (comp_str);
- }
+ if (cr->comp_anniversary)
+ e_cal_backend_notify_component_created (E_CAL_BACKEND (cbc), cr->comp_anniversary);
g_object_ref (G_OBJECT (contact));
static void
contact_record_free (ContactRecord *cr)
{
- gchar *comp_str;
ECalComponentId *id;
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_backend_notify_component_removed (E_CAL_BACKEND (cr->cbc), id, cr->comp_birthday, NULL);
e_cal_component_free_id (id);
- g_free (comp_str);
g_object_unref (G_OBJECT (cr->comp_birthday));
}
/* 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_anniversary);
- e_cal_backend_notify_object_removed (E_CAL_BACKEND (cr->cbc), id, comp_str, NULL);
+ e_cal_backend_notify_component_removed (E_CAL_BACKEND (cr->cbc), id, cr->comp_anniversary, NULL);
e_cal_component_free_id (id);
- g_free (comp_str);
g_object_unref (G_OBJECT (cr->comp_anniversary));
}
typedef struct _ContactRecordCB {
ECalBackendContacts *cbc;
ECalBackendSExp *sexp;
+ gboolean as_string;
GSList *result;
} ContactRecordCB;
static ContactRecordCB *
contact_record_cb_new (ECalBackendContacts *cbc,
- ECalBackendSExp *sexp)
+ ECalBackendSExp *sexp,
+ gboolean as_string)
{
ContactRecordCB *cb_data = g_new (ContactRecordCB, 1);
cb_data->cbc = cbc;
cb_data->sexp = sexp;
+ cb_data->as_string = as_string;
cb_data->result = NULL;
return cb_data;
static void
contact_record_cb_free (ContactRecordCB *cb_data)
{
- g_slist_foreach (cb_data->result, (GFunc) g_free, NULL);
+ if (cb_data->as_string)
+ g_slist_foreach (cb_data->result, (GFunc) g_free, NULL);
g_slist_free (cb_data->result);
g_free (cb_data);
{
ContactRecordCB *cb_data = user_data;
ContactRecord *record = value;
+ gpointer data;
if (record->comp_birthday && e_cal_backend_sexp_match_comp (cb_data->sexp, record->comp_birthday, E_CAL_BACKEND (cb_data->cbc))) {
- gchar * comp_str = e_cal_component_get_as_string (record->comp_birthday);
- cb_data->result = g_slist_append (cb_data->result, comp_str);
+ if (cb_data->as_string)
+ data = e_cal_component_get_as_string (record->comp_birthday);
+ else
+ data = record->comp_birthday;
+
+ cb_data->result = g_slist_prepend (cb_data->result, data);
}
if (record->comp_anniversary && e_cal_backend_sexp_match_comp (cb_data->sexp, record->comp_anniversary, E_CAL_BACKEND (cb_data->cbc))) {
- gchar * comp_str = e_cal_component_get_as_string (record->comp_anniversary);
- cb_data->result = g_slist_append (cb_data->result, comp_str);
+ if (cb_data->as_string)
+ data = e_cal_component_get_as_string (record->comp_anniversary);
+ else
+ data = record->comp_anniversary;
+
+ cb_data->result = g_slist_prepend (cb_data->result, data);
}
}
manage_comp_alarm_update (ECalBackendContacts *cbc,
ECalComponent *comp)
{
- gchar *old_comp, *new_comp;
+ gchar *old_comp_str, *new_comp_str;
+ ECalComponent *old_comp;
g_return_if_fail (cbc != NULL);
g_return_if_fail (comp != NULL);
- old_comp = e_cal_component_get_as_string (comp);
+ old_comp = e_cal_component_clone (comp);
setup_alarm (cbc, comp);
- new_comp = e_cal_component_get_as_string (comp);
+
+ old_comp_str = e_cal_component_get_as_string (old_comp);
+ new_comp_str = e_cal_component_get_as_string (comp);
/* check if component changed and notify if so */
- if (old_comp && new_comp && !g_str_equal (old_comp, new_comp))
- e_cal_backend_notify_object_modified (E_CAL_BACKEND (cbc), old_comp, new_comp);
+ if (old_comp_str && new_comp_str && !g_str_equal (old_comp_str, new_comp_str))
+ e_cal_backend_notify_component_modified (E_CAL_BACKEND (cbc), old_comp, comp);
- g_free (old_comp);
- g_free (new_comp);
+ g_free (old_comp_str);
+ g_free (new_comp_str);
+ g_object_unref (old_comp);
}
static void
return;
}
- cb_data = contact_record_cb_new (cbc, sexp);
+ cb_data = contact_record_cb_new (cbc, sexp, TRUE);
g_hash_table_foreach (priv->tracked_contacts, contact_record_cb, cb_data);
*objects = cb_data->result;
return;
}
- cb_data = contact_record_cb_new (cbc, sexp);
+ cb_data = contact_record_cb_new (cbc, sexp, FALSE);
g_hash_table_foreach (priv->tracked_contacts, contact_record_cb, cb_data);
- e_data_cal_view_notify_objects_added (query, cb_data->result);
+ e_data_cal_view_notify_components_added (query, cb_data->result);
contact_record_cb_free (cb_data);
GCancellable *cancellable,
const gchar *calobj,
gchar **uid,
- icalcomponent **new_component,
+ ECalComponent **new_component,
GError **perror)
{
g_propagate_error (perror, EDC_ERROR (PermissionDenied));
ECalBackendFileObject *old_obj_data = value;
if (!g_hash_table_lookup (context->new_uid_hash, uid)) {
- icalcomponent *old_icomp;
- gchar *old_obj_str;
- ECalComponent *comp;
ECalComponentId *id;
/* Object was removed */
- old_icomp = e_cal_component_get_icalcomponent (old_obj_data->full_object);
- if (!old_icomp)
- return;
-
- old_obj_str = icalcomponent_as_ical_string_r (old_icomp);
- if (!old_obj_str)
+ if (!old_obj_data->full_object)
return;
- comp = e_cal_component_new_from_string (old_obj_str);
- id = e_cal_component_get_id (comp);
+ id = e_cal_component_get_id (old_obj_data->full_object);
- e_cal_backend_notify_object_removed (context->backend, id, old_obj_str, NULL);
+ e_cal_backend_notify_component_removed (context->backend, id, old_obj_data->full_object, NULL);
e_cal_component_free_id (id);
- g_free (old_obj_str);
- g_object_unref (comp);
}
}
const gchar *uid = key;
ECalBackendFileObject *new_obj_data = value;
ECalBackendFileObject *old_obj_data;
- icalcomponent *old_icomp, *new_icomp;
- gchar *old_obj_str, *new_obj_str;
old_obj_data = g_hash_table_lookup (context->old_uid_hash, uid);
if (!old_obj_data) {
/* Object was added */
-
- new_icomp = e_cal_component_get_icalcomponent (new_obj_data->full_object);
- if (!new_icomp)
+ if (!new_obj_data->full_object)
return;
- e_cal_backend_notify_component_created (context->backend, new_icomp);
+ e_cal_backend_notify_component_created (context->backend, new_obj_data->full_object);
} else {
- old_icomp = e_cal_component_get_icalcomponent (old_obj_data->full_object);
- new_icomp = e_cal_component_get_icalcomponent (new_obj_data->full_object);
- if (!old_icomp || !new_icomp)
+ gchar *old_obj_str, *new_obj_str;
+
+ if (!old_obj_data->full_object || !new_obj_data->full_object)
return;
/* There should be better ways to compare an icalcomponent
* than serializing and comparing the strings...
*/
- old_obj_str = icalcomponent_as_ical_string_r (old_icomp);
- new_obj_str = icalcomponent_as_ical_string_r (new_icomp);
- if (!old_obj_str || !new_obj_str)
- return;
-
- if (strcmp (old_obj_str, new_obj_str)) {
+ old_obj_str = e_cal_component_get_as_string (old_obj_data->full_object);
+ new_obj_str = e_cal_component_get_as_string (new_obj_data->full_object);
+ if (old_obj_str && new_obj_str && strcmp (old_obj_str, new_obj_str) != 0) {
/* Object was modified */
- e_cal_backend_notify_component_modified (context->backend, old_icomp, new_icomp);
+ e_cal_backend_notify_component_modified (context->backend, old_obj_data->full_object, new_obj_data->full_object);
}
+
g_free (old_obj_str);
g_free (new_obj_str);
}
}
typedef struct {
- GSList *obj_list;
+ GSList *comps_list;
gboolean search_needed;
const gchar *query;
ECalBackendSExp *obj_sexp;
ECalBackend *backend;
EDataCalView *view;
+ gboolean as_string;
} MatchObjectData;
-static GSList *
-prepend_component (GSList *list,
- MatchObjectData *match_data,
- icalcomponent *icalcomp)
-{
- gchar *str;
-
- if (match_data->view)
- str = e_data_cal_view_get_component_string (match_data->view, icalcomp);
- else
- str = icalcomponent_as_ical_string_r (icalcomp);
-
- return g_slist_prepend (list, str);
-}
-
static void
match_object_sexp_to_component (gpointer value,
gpointer data)
const gchar *uid;
ECalBackendFile *cbfile;
ECalBackendFilePrivate *priv;
- icalcomponent *icalcomp;
e_cal_component_get_uid (comp, &uid);
g_return_if_fail (priv != NULL);
- icalcomp = e_cal_component_get_icalcomponent (comp);
-
if ((!match_data->search_needed) ||
(e_cal_backend_sexp_match_comp (match_data->obj_sexp, comp, match_data->backend))) {
- match_data->obj_list = prepend_component (match_data->obj_list, match_data, icalcomp);
+ if (match_data->as_string)
+ match_data->comps_list = g_slist_prepend (match_data->comps_list, e_cal_component_get_as_string (comp));
+ else
+ match_data->comps_list = g_slist_prepend (match_data->comps_list, comp);
}
}
gpointer data)
{
ECalComponent *comp = value;
- icalcomponent *icalcomp;
MatchObjectData *match_data = data;
- icalcomp = e_cal_component_get_icalcomponent (comp);
-
if ((!match_data->search_needed) ||
(e_cal_backend_sexp_match_comp (match_data->obj_sexp, comp, match_data->backend))) {
- match_data->obj_list = prepend_component (match_data->obj_list, match_data, icalcomp);
+ if (match_data->as_string)
+ match_data->comps_list = g_slist_prepend (match_data->comps_list, e_cal_component_get_as_string (comp));
+ else
+ match_data->comps_list = g_slist_prepend (match_data->comps_list, comp);
}
}
(e_cal_backend_sexp_match_comp (match_data->obj_sexp,
obj_data->full_object,
match_data->backend))) {
- icalcomponent *icalcomp =
- e_cal_component_get_icalcomponent (obj_data->full_object);
-
- match_data->obj_list = prepend_component (match_data->obj_list, match_data, icalcomp);
+ if (match_data->as_string)
+ match_data->comps_list = g_slist_prepend (match_data->comps_list, e_cal_component_get_as_string (obj_data->full_object));
+ else
+ match_data->comps_list = g_slist_prepend (match_data->comps_list, obj_data->full_object);
}
}
match_data.search_needed = TRUE;
match_data.query = sexp;
- match_data.obj_list = NULL;
+ match_data.comps_list = NULL;
+ match_data.as_string = TRUE;
match_data.backend = E_CAL_BACKEND (backend);
if (!strcmp (sexp, "#t"))
g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
- *objects = g_slist_reverse (match_data.obj_list);
+ *objects = g_slist_reverse (match_data.comps_list);
if (objs_occuring_in_tw) {
g_list_foreach (objs_occuring_in_tw, (GFunc) g_object_unref, NULL);
/* try to match all currently existing objects */
match_data.search_needed = TRUE;
match_data.query = e_data_cal_view_get_text (query);
- match_data.obj_list = NULL;
+ match_data.comps_list = NULL;
+ match_data.as_string = FALSE;
match_data.backend = backend;
match_data.obj_sexp = e_data_cal_view_get_object_sexp (query);
match_data.view = query;
g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
/* notify listeners of all objects */
- if (match_data.obj_list) {
- match_data.obj_list = g_slist_reverse (match_data.obj_list);
+ if (match_data.comps_list) {
+ match_data.comps_list = g_slist_reverse (match_data.comps_list);
- e_data_cal_view_notify_objects_added (query, match_data.obj_list);
+ e_data_cal_view_notify_components_added (query, match_data.comps_list);
/* free memory */
- g_slist_foreach (match_data.obj_list, (GFunc) g_free, NULL);
- g_slist_free (match_data.obj_list);
+ g_slist_free (match_data.comps_list);
}
if (objs_occuring_in_tw) {
GCancellable *cancellable,
const gchar *in_calobj,
gchar **uid,
- icalcomponent **new_component,
+ ECalComponent **new_component,
GError **error)
{
ECalBackendFile *cbfile;
if (uid)
*uid = g_strdup (comp_uid);
- *new_component = icalcomponent_new_clone (icalcomp);
+ *new_component = e_cal_component_clone (comp);
g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
}
GCancellable *cancellable,
const gchar *calobj,
CalObjModType mod,
- icalcomponent **old_component,
- icalcomponent **new_component,
+ ECalComponent **old_component,
+ ECalComponent **new_component,
GError **error)
{
RemoveRecurrenceData rrdata;
case CALOBJ_MOD_THIS :
if (!rid || !*rid) {
if (old_component && obj_data->full_object) {
- icalcomponent *old_icalcomp =
- e_cal_component_get_icalcomponent (obj_data->full_object);
- *old_component = icalcomponent_new_clone (old_icalcomp);
+ *old_component = e_cal_component_clone (obj_data->full_object);
}
/* replace only the full object */
save (cbfile, TRUE);
if (new_component) {
- icalcomponent *new_icalcomp =
- e_cal_component_get_icalcomponent (comp);
- *new_component = icalcomponent_new_clone (new_icalcomp);
+ *new_component = e_cal_component_clone (comp);
}
g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
if (g_hash_table_lookup_extended (obj_data->recurrences, rid, (gpointer *) &real_rid, (gpointer *) &recurrence)) {
if (old_component) {
- icalcomponent *old_icalcomp =
- e_cal_component_get_icalcomponent (recurrence);
- *old_component = icalcomponent_new_clone (old_icalcomp);
+ *old_component = e_cal_component_clone (recurrence);
}
/* remove the component from our data */
if (!rid || !*rid) {
if (old_component && obj_data->full_object) {
- icalcomponent *old_icalcomp =
- e_cal_component_get_icalcomponent (obj_data->full_object);
- *old_component = icalcomponent_new_clone (old_icalcomp);
+ *old_component = e_cal_component_clone (obj_data->full_object);
}
remove_component (cbfile, comp_uid, obj_data);
(gpointer *) &real_rid, (gpointer *) &recurrence)) {
if (old_component) {
- icalcomponent *old_icalcomp =
- e_cal_component_get_icalcomponent (recurrence);
- *old_component = icalcomponent_new_clone (old_icalcomp);
+ *old_component = e_cal_component_clone (recurrence);
}
/* remove the component from our data */
} else {
if (old_component && obj_data->full_object) {
- icalcomponent *old_icalcomp =
- e_cal_component_get_icalcomponent (obj_data->full_object);
- *old_component = icalcomponent_new_clone (old_icalcomp);
+ *old_component = e_cal_component_clone (obj_data->full_object);
}
}
case CALOBJ_MOD_ALL :
/* Remove the old version */
if (old_component && obj_data->full_object) {
- icalcomponent *old_icalcomp =
- e_cal_component_get_icalcomponent (obj_data->full_object);
- *old_component = icalcomponent_new_clone (old_icalcomp);
+ *old_component = e_cal_component_clone (obj_data->full_object);
}
if (obj_data->recurrences_list) {
}
break;
case CALOBJ_MOD_ONLY_THIS:
- // not reached, keep compiler happy
+ /* not reached, keep compiler happy */
break;
}
g_free (rid);
if (new_component) {
- icalcomponent *new_icalcomp =
- e_cal_component_get_icalcomponent (comp);
- *new_component = icalcomponent_new_clone (new_icalcomp);
+ *new_component = e_cal_component_clone (comp);
}
g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
const gchar *uid,
const gchar *rid,
CalObjModType mod,
- icalcomponent **old_component,
- icalcomponent **component,
+ ECalComponent **old_comp,
+ ECalComponent **new_comp,
GError **error)
{
gchar *hash_rid;
(gpointer *) &hash_rid, (gpointer *) &comp)) {
/* Removing without parent or not modifying parent?
* Report removal to caller. */
- if (old_component &&
+ if (old_comp &&
(!obj_data->full_object || mod == CALOBJ_MOD_ONLY_THIS)) {
- icalcomponent *icalcomp =
- e_cal_component_get_icalcomponent (comp);
-
- *old_component = icalcomponent_new_clone (icalcomp);
+ *old_comp = e_cal_component_clone (comp);
}
/* Reporting parent modification to caller?
ECalComponentId id;
id.uid = (gchar *) uid;
id.rid = (gchar *) rid;
- e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbfile), &id, NULL, NULL);
+ e_cal_backend_notify_component_removed (E_CAL_BACKEND (cbfile), &id, NULL, NULL);
}
/* remove the component from our data */
cbfile->priv->comp = g_list_remove (cbfile->priv->comp, obj_data->full_object);
/* add EXDATE or EXRULE to parent, report as update */
- if (old_component) {
- icalcomponent *icalcomp =
- e_cal_component_get_icalcomponent (obj_data->full_object);
-
- *old_component = icalcomponent_new_clone (icalcomp);
+ if (old_comp) {
+ *old_comp = e_cal_component_clone (obj_data->full_object);
}
e_cal_util_remove_instances (e_cal_component_get_icalcomponent (obj_data->full_object),
e_cal_component_set_last_modified (obj_data->full_object, ¤t);
/* report update */
- if (component) {
- icalcomponent *icalcomp =
- e_cal_component_get_icalcomponent (obj_data->full_object);
-
- *component = icalcomponent_new_clone (icalcomp);
+ if (new_comp) {
+ *new_comp = e_cal_component_clone (obj_data->full_object);
}
/* add the modified object to the beginning of the list,
cbfile->priv->comp = g_list_remove (cbfile->priv->comp, obj_data->full_object);
/* remove parent, report as removal */
- if (old_component) {
- icalcomponent *icalcomp =
- e_cal_component_get_icalcomponent (obj_data->full_object);
-
- *old_component = icalcomponent_new_clone (icalcomp);
+ if (old_comp) {
+ *old_comp = g_object_ref (obj_data->full_object);
}
g_object_unref (obj_data->full_object);
obj_data->full_object = NULL;
return obj_data;
}
-static icalcomponent *
-clone_icalcomp_from_fileobject (ECalBackendFileObject *obj_data,
+static ECalComponent *
+clone_ecalcomp_from_fileobject (ECalBackendFileObject *obj_data,
const gchar *rid)
{
ECalComponent *comp = obj_data->full_object;
- icalcomponent *icalcomp = NULL;
gchar *real_rid;
if (!comp)
return NULL;
- if (!rid) {
- icalcomp = e_cal_component_get_icalcomponent (comp);
- } else {
- if (g_hash_table_lookup_extended (obj_data->recurrences, rid,
- (gpointer *) &real_rid, (gpointer *) &comp))
- icalcomp = e_cal_component_get_icalcomponent (comp);
- else {
+ if (rid) {
+ if (!g_hash_table_lookup_extended (obj_data->recurrences, rid,
+ (gpointer *) &real_rid, (gpointer *) &comp)) {
/* FIXME remove this once we delete an instance from master object through
* modify request by setting exception */
- icalcomp = e_cal_component_get_icalcomponent (comp);
+ comp = obj_data->full_object;
}
}
- return icalcomp ? icalcomponent_new_clone (icalcomp) : NULL;
+ return comp ? e_cal_component_clone (comp) : NULL;
}
static void
ECalComponent *comp = pecalcomp;
ECalBackend *backend = pbackend;
ECalComponentId *id;
- gchar *compstr;
g_return_if_fail (comp != NULL);
g_return_if_fail (backend != NULL);
id = e_cal_component_get_id (comp);
g_return_if_fail (id != NULL);
- compstr = e_cal_component_get_as_string (comp);
-
- e_cal_backend_notify_object_removed (backend, id, compstr, NULL);
+ e_cal_backend_notify_component_removed (backend, id, comp, NULL);
e_cal_component_free_id (id);
- g_free (compstr);
}
/* Remove_object handler for the file backend */
const gchar *uid,
const gchar *rid,
CalObjModType mod,
- icalcomponent **old_component,
- icalcomponent **component,
+ ECalComponent **old_component,
+ ECalComponent **new_component,
GError **error)
{
ECalBackendFile *cbfile;
return;
}
- *old_component = *component = NULL;
+ *old_component = *new_component = NULL;
g_static_rec_mutex_lock (&priv->idle_save_rmutex);
switch (mod) {
case CALOBJ_MOD_ALL :
- *old_component = clone_icalcomp_from_fileobject (obj_data, recur_id);
+ *old_component = clone_ecalcomp_from_fileobject (obj_data, recur_id);
if (obj_data->recurrences_list)
g_list_foreach (obj_data->recurrences_list, notify_comp_removed_cb, cbfile);
remove_component (cbfile, uid, obj_data);
- *component = NULL;
+ *new_component = NULL;
break;
case CALOBJ_MOD_ONLY_THIS:
case CALOBJ_MOD_THIS :
obj_data = remove_instance (cbfile, obj_data, uid, recur_id, mod,
- old_component, component, error);
+ old_component, new_component, error);
break;
case CALOBJ_MOD_THISANDPRIOR :
case CALOBJ_MOD_THISANDFUTURE :
}
if (comp) {
- icalcomponent *icalcomp =
- e_cal_component_get_icalcomponent (comp);
- *old_component = icalcomponent_new_clone (icalcomp);
+ *old_component = e_cal_component_clone (comp);
/* remove the component from our data, temporarily */
icalcomponent_remove_component (priv->icalcomp,
priv->comp = g_list_prepend (priv->comp, comp);
if (obj_data->full_object) {
- icalcomponent *icalcomp =
- e_cal_component_get_icalcomponent (obj_data->full_object);
-
- *component = icalcomponent_new_clone (icalcomp);
+ *new_component = e_cal_component_clone (obj_data->full_object);
}
break;
}
static gboolean
cancel_received_object (ECalBackendFile *cbfile,
- icalcomponent *icalcomp,
- icalcomponent **old_icalcomp,
- icalcomponent **new_icalcomp)
+ ECalComponent *comp,
+ ECalComponent **old_comp,
+ ECalComponent **new_comp)
{
ECalBackendFileObject *obj_data;
ECalBackendFilePrivate *priv;
gchar *rid;
- ECalComponent *comp;
- const gchar *uid = icalcomponent_get_uid (icalcomp);
+ const gchar *uid = NULL;
priv = cbfile->priv;
- *old_icalcomp = NULL;
- *new_icalcomp = NULL;
+ *old_comp = NULL;
+ *new_comp = NULL;
+
+ e_cal_component_get_uid (comp, &uid);
/* Find the old version of the component. */
obj_data = g_hash_table_lookup (priv->comp_uid_hash, uid);
return FALSE;
/* And remove it */
- comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp))) {
- g_object_unref (comp);
- return FALSE;
- }
-
rid = e_cal_component_get_recurid_as_string (comp);
if (rid && *rid) {
obj_data = remove_instance (cbfile, obj_data, uid, rid, CALOBJ_MOD_THIS,
- old_icalcomp, new_icalcomp, NULL);
- if (obj_data && obj_data->full_object) {
- icalcomponent *tmp_icalcomp =
- e_cal_component_get_icalcomponent (obj_data->full_object);
- *new_icalcomp = icalcomponent_new_clone (tmp_icalcomp);
+ old_comp, new_comp, NULL);
+ if (obj_data && obj_data->full_object && !*new_comp) {
+ *new_comp = e_cal_component_clone (obj_data->full_object);
}
} else {
/* report as removal by keeping *new_component NULL */
if (obj_data->full_object) {
- icalcomponent *tmp_icalcomp =
- e_cal_component_get_icalcomponent (obj_data->full_object);
- *old_icalcomp = icalcomponent_new_clone (tmp_icalcomp);
+ *old_comp = e_cal_component_clone (obj_data->full_object);
}
remove_component (cbfile, uid, obj_data);
}
/* Now we manipulate the components we care about */
for (l = comps; l; l = l->next) {
- icalcomponent *old_component = NULL;
- icalcomponent *component = NULL;
+ ECalComponent *old_component = NULL;
+ ECalComponent *new_component = NULL;
const gchar *uid;
gchar *rid;
ECalBackendFileObject *obj_data;
if (obj_data) {
if (rid) {
- icalcomponent *ignore_icalcomp = NULL;
+ ECalComponent *ignore_comp = NULL;
remove_instance (cbfile, obj_data, uid, rid, CALOBJ_MOD_THIS,
- &old_component, &ignore_icalcomp, NULL);
+ &old_component, &ignore_comp, NULL);
- if (ignore_icalcomp)
- icalcomponent_free (ignore_icalcomp);
+ if (ignore_comp)
+ g_object_unref (ignore_comp);
} else {
if (obj_data->full_object) {
- icalcomponent *full_icalcomp =
- e_cal_component_get_icalcomponent (obj_data->full_object);
- old_component = icalcomponent_new_clone (full_icalcomp);
+ old_component = e_cal_component_clone (obj_data->full_object);
}
remove_component (cbfile, uid, obj_data);
}
if (!is_declined)
add_component (cbfile, comp, FALSE);
- component = icalcomponent_new_clone (e_cal_component_get_icalcomponent (comp));
if (!is_declined)
e_cal_backend_notify_component_modified (E_CAL_BACKEND (backend),
- old_component, component);
+ old_component, comp);
else {
ECalComponentId *id = e_cal_component_get_id (comp);
e_cal_backend_notify_component_removed (E_CAL_BACKEND (backend),
id, old_component,
- rid ? component : NULL);
+ rid ? comp : NULL);
e_cal_component_free_id (id);
}
- if (component)
- icalcomponent_free (component);
if (old_component)
- icalcomponent_free (old_component);
+ g_object_unref (old_component);
} else if (!is_declined) {
add_component (cbfile, comp, FALSE);
- component = e_cal_component_get_icalcomponent (comp);
-
- e_cal_backend_notify_component_created (E_CAL_BACKEND (backend), component);
+ e_cal_backend_notify_component_created (E_CAL_BACKEND (backend), comp);
}
g_free (rid);
break;
goto error;
break;
case ICAL_METHOD_CANCEL:
- old_component = NULL;
- component = NULL;
- if (cancel_received_object (cbfile, subcomp, &old_component, &component)) {
+ if (cancel_received_object (cbfile, comp, &old_component, &new_component)) {
ECalComponentId *id;
id = e_cal_component_get_id (comp);
e_cal_backend_notify_component_removed (E_CAL_BACKEND (backend),
- id, old_component, component);
+ id, old_component, new_component);
/* remove the component from the toplevel VCALENDAR */
icalcomponent_remove_component (toplevel_comp, subcomp);
icalcomponent_free (subcomp);
e_cal_component_free_id (id);
- if (component)
- icalcomponent_free (component);
+ if (new_component)
+ g_object_unref (new_component);
if (old_component)
- icalcomponent_free (old_component);
+ g_object_unref (old_component);
}
g_free (rid);
break;
match_data.search_needed = TRUE;
match_data.query = sexp;
- match_data.obj_list = NULL;
+ match_data.comps_list = NULL;
+ match_data.as_string = TRUE;
match_data.backend = E_CAL_BACKEND (cbfile);
if (!strcmp (sexp, "#t"))
g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
- *objects = g_slist_reverse (match_data.obj_list);
+ *objects = g_slist_reverse (match_data.comps_list);
g_object_unref (match_data.obj_sexp);
}
ECalComponentId *id = e_cal_component_get_id (comp);
e_cal_backend_store_remove_component (cbhttp->priv->store, id->uid, id->rid);
- e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbhttp), id, calobj, NULL);
+ e_cal_backend_notify_component_removed (E_CAL_BACKEND (cbhttp), id, comp, NULL);
e_cal_component_free_id (id);
g_object_unref (comp);
comps = e_cal_backend_store_get_components (priv->store);
for (l = comps; l != NULL; l = g_slist_next (l)) {
- gchar *comp_str;
ECalComponentId *id;
ECalComponent *comp = l->data;
id = e_cal_component_get_id (comp);
- comp_str = e_cal_component_get_as_string (comp);
- e_cal_backend_notify_object_removed ((ECalBackend *) cbhttp, id, comp_str, NULL);
+ e_cal_backend_notify_component_removed ((ECalBackend *) cbhttp, id, comp, NULL);
- g_free (comp_str);
e_cal_component_free_id (id);
g_object_unref (comp);
}
if (e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (subcomp))) {
const gchar *uid;
gpointer orig_key, orig_value;
- gchar *obj;
e_cal_component_get_uid (comp, &uid);
if (!put_component_to_store (cbhttp, comp)) {
g_hash_table_remove (old_cache, uid);
} else if (g_hash_table_lookup_extended (old_cache, uid, &orig_key, &orig_value)) {
- obj = icalcomponent_as_ical_string_r (subcomp);
- e_cal_backend_notify_object_modified (E_CAL_BACKEND (cbhttp), (const gchar *) orig_value, obj);
- g_free (obj);
+ ECalComponent *orig_comp = e_cal_component_new_from_string (orig_value);
+
+ e_cal_backend_notify_component_modified (E_CAL_BACKEND (cbhttp), orig_comp, comp);
+
g_hash_table_remove (old_cache, uid);
+ if (orig_comp)
+ g_object_unref (orig_comp);
} else {
- obj = icalcomponent_as_ical_string_r (subcomp);
- e_cal_backend_notify_object_created (E_CAL_BACKEND (cbhttp), obj);
- g_free (obj);
+ e_cal_backend_notify_component_created (E_CAL_BACKEND (cbhttp), comp);
}
}
: e_cal_backend_store_get_components (priv->store);
for (l = components; l != NULL; l = g_slist_next (l)) {
- if (e_cal_backend_sexp_match_comp (cbsexp, E_CAL_COMPONENT (l->data), E_CAL_BACKEND (backend))) {
- objects = g_slist_append (objects, e_cal_component_get_as_string (l->data));
+ ECalComponent *comp = l->data;
+
+ if (e_cal_backend_sexp_match_comp (cbsexp, comp, E_CAL_BACKEND (backend))) {
+ objects = g_slist_append (objects, comp);
}
}
- e_data_cal_view_notify_objects_added (query, objects);
+ e_data_cal_view_notify_components_added (query, objects);
- g_slist_foreach (components, (GFunc) g_object_unref, NULL);
- g_slist_free (components);
- g_slist_foreach (objects, (GFunc) g_free, NULL);
+ g_slist_free_full (components, g_object_unref);
g_slist_free (objects);
g_object_unref (cbsexp);
GCancellable *cancellable,
const gchar *calobj,
gchar **uid,
- icalcomponent **new_component,
+ ECalComponent **new_component,
GError **perror)
{
g_propagate_error (perror, EDC_ERROR (PermissionDenied));
GCancellable *cancellable,
const gchar *calobj,
CalObjModType mod,
- icalcomponent **old_component,
- icalcomponent **component,
+ ECalComponent **old_component,
+ ECalComponent **new_component,
GError **perror)
{
g_propagate_error (perror, EDC_ERROR (PermissionDenied));
const gchar *uid,
const gchar *rid,
CalObjModType mod,
- icalcomponent **old_component,
- icalcomponent **component,
+ ECalComponent **old_component,
+ ECalComponent **new_component,
GError **perror)
{
- *old_component = *component = NULL;
+ *old_component = *new_component = NULL;
g_propagate_error (perror, EDC_ERROR (PermissionDenied));
}
{
ECalBackendWeatherPrivate *priv;
ECalComponent *comp;
- icalcomponent *icomp;
- GSList *l;
- gchar *obj;
+ GSList *comps, *l;
priv = cbw->priv;
}
/* update cache */
- l = e_cal_backend_store_get_components (priv->store);
+ comps = e_cal_backend_store_get_components (priv->store);
- for (; l != NULL; l = g_slist_next (l)) {
+ for (l = comps; l != NULL; l = g_slist_next (l)) {
ECalComponentId *id;
- gchar *obj;
- icomp = e_cal_component_get_icalcomponent (E_CAL_COMPONENT (l->data));
- id = e_cal_component_get_id (E_CAL_COMPONENT (l->data));
+ comp = E_CAL_COMPONENT (l->data);
+ id = e_cal_component_get_id (comp);
- obj = icalcomponent_as_ical_string_r (icomp);
- e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbw),
- id,
- obj,
- NULL);
+ e_cal_backend_notify_component_removed (E_CAL_BACKEND (cbw), id, comp, NULL);
e_cal_component_free_id (id);
- g_free (obj);
- g_object_unref (G_OBJECT (l->data));
+ g_object_unref (comp);
}
- g_slist_free (l);
+ g_slist_free (comps);
e_cal_backend_store_clean (priv->store);
comp = create_weather (cbw, info, FALSE);
GSList *forecasts;
put_component_to_store (cbw, comp);
- icomp = e_cal_component_get_icalcomponent (comp);
- obj = icalcomponent_as_ical_string_r (icomp);
- e_cal_backend_notify_object_created (E_CAL_BACKEND (cbw), obj);
- g_free (obj);
+ e_cal_backend_notify_component_created (E_CAL_BACKEND (cbw), comp);
g_object_unref (comp);
forecasts = weather_info_get_forecast_list (info);
comp = create_weather (cbw, nfo, TRUE);
if (comp) {
put_component_to_store (cbw, comp);
- icomp = e_cal_component_get_icalcomponent (comp);
- obj = icalcomponent_as_ical_string_r (icomp);
- e_cal_backend_notify_object_created (E_CAL_BACKEND (cbw), obj);
- g_free (obj);
+ e_cal_backend_notify_component_created (E_CAL_BACKEND (cbw), comp);
g_object_unref (comp);
}
}
for (l = components; l != NULL; l = g_slist_next (l)) {
if (e_cal_backend_sexp_match_comp (sexp, E_CAL_COMPONENT (l->data), backend))
- objects = g_slist_append (objects, e_cal_component_get_as_string (l->data));
+ objects = g_slist_prepend (objects, l->data);
}
if (objects)
- e_data_cal_view_notify_objects_added (query, objects);
+ e_data_cal_view_notify_components_added (query, objects);
- g_slist_foreach (components, (GFunc) g_object_unref, NULL);
- g_slist_free (components);
- g_slist_foreach (objects, (GFunc) g_free, NULL);
+ g_slist_free_full (components, g_object_unref);
g_slist_free (objects);
e_data_cal_view_notify_complete (query, NULL /* Success */);
ECalComponent *
e_cal_component_new_from_string (const gchar *calobj)
{
- ECalComponent *comp;
icalcomponent *icalcomp;
g_return_val_if_fail (calobj != NULL, NULL);
if (!icalcomp)
return NULL;
+ return e_cal_component_new_from_icalcomponent (icalcomp);
+}
+
+/**
+ * e_cal_component_new_from_icalcomponent:
+ * @icalcomp: An #icalcomponent to use
+ *
+ * Creates a new #ECalComponent which will has set @icalcomp as
+ * an inner #icalcomponent. The newly created #ECalComponent takes
+ * ownership of the @icalcomp, and if the call
+ * to e_cal_component_set_icalcomponent() fails, then @icalcomp
+ * is freed.
+ *
+ * Returns: An #ECalComponet with @icalcomp assigned on success,
+ * NULL if the @icalcomp cannot be assigned to #ECalComponent.
+ *
+ * Since: 3.4
+ **/
+ECalComponent *
+e_cal_component_new_from_icalcomponent (icalcomponent *icalcomp)
+{
+ ECalComponent *comp;
+
+ g_return_val_if_fail (icalcomp != NULL, NULL);
+
comp = e_cal_component_new ();
if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
icalcomponent_free (icalcomp);
ECalComponent *e_cal_component_new (void);
ECalComponent *e_cal_component_new_from_string (const gchar *calobj);
+ECalComponent *e_cal_component_new_from_icalcomponent (icalcomponent *icalcomp);
ECalComponent *e_cal_component_clone (ECalComponent *comp);
* @cancellable: a #GCancellable for the operation
* @calobj: The object to be added.
* @uid: Placeholder for server-generated UID.
- * @new_component: (out) (transfer full): Placeholder for returned #icalcomponent.
+ * @new_component: (out) (transfer full): Placeholder for returned #ECalComponent.
* @error: Out parameter for a #GError.
*
* Calls the create_object_sync method on the given backend.
GCancellable *cancellable,
const gchar *calobj,
gchar **uid,
- icalcomponent **new_component,
+ ECalComponent **new_component,
GError **error)
{
e_return_data_cal_error_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), InvalidArg);
GCancellable *cancellable,
const gchar *calobj,
CalObjModType mod,
- icalcomponent **old_component,
- icalcomponent **new_component,
+ ECalComponent **old_component,
+ ECalComponent **new_component,
GError **error)
{
e_return_data_cal_error_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), InvalidArg);
const gchar *uid,
const gchar *rid,
CalObjModType mod,
- icalcomponent **old_component,
- icalcomponent **new_component,
+ ECalComponent **old_component,
+ ECalComponent **new_component,
GError **error)
{
e_return_data_cal_error_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), InvalidArg);
{
GError *error = NULL;
gchar *uid = NULL;
- icalcomponent *new_component = NULL;
+ ECalComponent *new_component = NULL;
e_cal_backend_sync_create_object (E_CAL_BACKEND_SYNC (backend), cal, cancellable, calobj, &uid, &new_component, &error);
if (!new_component)
- new_component = icalparser_parse_string (calobj);
+ new_component = e_cal_component_new_from_string (calobj);
e_data_cal_respond_create_object (cal, opid, error, uid, new_component);
g_free (uid);
if (new_component)
- icalcomponent_free (new_component);
+ g_object_unref (new_component);
}
static void
CalObjModType mod)
{
GError *error = NULL;
- icalcomponent *old_component = NULL, *new_component = NULL;
+ ECalComponent *old_component = NULL, *new_component = NULL;
e_cal_backend_sync_modify_object (E_CAL_BACKEND_SYNC (backend), cal, cancellable, calobj, mod, &old_component, &new_component, &error);
if (!old_component)
- old_component = icalparser_parse_string (calobj);
+ old_component = e_cal_component_new_from_string (calobj);
e_data_cal_respond_modify_object (cal, opid, error, old_component, new_component);
if (old_component)
- icalcomponent_free (old_component);
+ g_object_unref (old_component);
if (new_component)
- icalcomponent_free (new_component);
+ g_object_unref (new_component);
}
static void
CalObjModType mod)
{
GError *error = NULL;
- icalcomponent *old_component = NULL, *new_component = NULL;
+ ECalComponent *old_component = NULL, *new_component = NULL;
ECalComponentId compid;
compid.uid = (gchar *) uid;
e_data_cal_respond_remove_object (cal, opid, error, &compid, old_component, new_component);
if (old_component)
- icalcomponent_free (old_component);
+ g_object_unref (old_component);
if (new_component)
- icalcomponent_free (new_component);
+ g_object_unref (new_component);
}
static void
void (* get_object_sync) (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *uid, const gchar *rid, gchar **calobj, GError **error);
void (* get_object_list_sync) (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *sexp, GSList **calobjs, GError **error);
void (* get_free_busy_sync) (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const GSList *users, time_t start, time_t end, GSList **freebusyobjs, GError **error);
- void (* create_object_sync) (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *calobj, gchar **uid, icalcomponent **new_component, GError **error);
- void (* modify_object_sync) (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *calobj, CalObjModType mod, icalcomponent **old_component, icalcomponent **new_component, GError **error);
- void (* remove_object_sync) (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *uid, const gchar *rid, CalObjModType mod, icalcomponent **old_component, icalcomponent **new_component, GError **error);
+ void (* create_object_sync) (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *calobj, gchar **uid, ECalComponent **new_component, GError **error);
+ void (* modify_object_sync) (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *calobj, CalObjModType mod, ECalComponent **old_component, ECalComponent **new_component, GError **error);
+ void (* remove_object_sync) (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *uid, const gchar *rid, CalObjModType mod, ECalComponent **old_component, ECalComponent **new_component, GError **error);
void (* receive_objects_sync) (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *calobj, GError **error);
void (* send_objects_sync) (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *calobj, GSList **users, gchar **modified_calobj, GError **error);
void (* get_attachment_uris_sync) (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *uid, const gchar *rid, GSList **attachments, GError **error);
void e_cal_backend_sync_get_object (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *uid, const gchar *rid, gchar **calobj, GError **error);
void e_cal_backend_sync_get_object_list (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *sexp, GSList **calobjs, GError **error);
void e_cal_backend_sync_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const GSList *users, time_t start, time_t end, GSList **freebusyobjects, GError **error);
-void e_cal_backend_sync_create_object (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *calobj, gchar **uid, icalcomponent **new_component, GError **error);
-void e_cal_backend_sync_modify_object (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *calobj, CalObjModType mod, icalcomponent **old_component, icalcomponent **new_component, GError **error);
-void e_cal_backend_sync_remove_object (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *uid, const gchar *rid, CalObjModType mod, icalcomponent **old_component, icalcomponent **new_component, GError **error);
+void e_cal_backend_sync_create_object (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *calobj, gchar **uid, ECalComponent **new_component, GError **error);
+void e_cal_backend_sync_modify_object (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *calobj, CalObjModType mod, ECalComponent **old_component, ECalComponent **new_component, GError **error);
+void e_cal_backend_sync_remove_object (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *uid, const gchar *rid, CalObjModType mod, ECalComponent **old_component, ECalComponent **new_component, GError **error);
void e_cal_backend_sync_receive_objects (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *calobj, GError **error);
void e_cal_backend_sync_send_objects (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *calobj, GSList **users, gchar **modified_calobj, GError **error);
void e_cal_backend_sync_get_attachment_uris (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *uid, const gchar *rid, GSList **attachments, GError **error);
component_created_cb (EDataCalView *view,
gpointer data)
{
- ECalComponent *comp = (ECalComponent *) data;
- icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
+ ECalComponent *comp = data;
if (e_data_cal_view_component_matches (view, comp))
- e_data_cal_view_notify_components_added_1 (view, icalcomp);
+ e_data_cal_view_notify_components_added_1 (view, comp);
return TRUE;
}
-static ECalComponent *
-ecal_comp_from_icalcomp (const icalcomponent *component)
-{
- ECalComponent *comp = NULL;
- icalcomponent *icalclone;
-
- if (component) {
- comp = e_cal_component_new ();
- icalclone = icalcomponent_new_clone ((icalcomponent *) component);
-
- if (!e_cal_component_set_icalcomponent (comp, icalclone)) {
- g_warning ("ecal_comp_from_icalcomp failed to set icalcomponent");
-
- icalcomponent_free (icalclone);
- g_object_unref (comp);
- comp = NULL;
- }
- }
-
- return comp;
-}
-
/**
* e_cal_backend_notify_component_created:
* @backend: an #ECalBackend
- * @component: the newly created #icalcomponent
+ * @component: the newly created #ECalComponent
*
* Notifies each of the backend's listeners about a new object.
*
- * Like e_cal_backend_notify_object_created() except takes an #icalcomponent
+ * Like e_cal_backend_notify_object_created() except takes an #ECalComponent
* instead of an ical string representation and uses the #EDataCalView's
* fields-of-interest to filter out unwanted information from ical strings
* sent over the bus.
**/
void
e_cal_backend_notify_component_created (ECalBackend *backend,
- const icalcomponent *component)
+ /* const */ ECalComponent *component)
{
ECalBackendPrivate *priv;
- ECalComponent *comp;
priv = backend->priv;
return;
}
- comp = ecal_comp_from_icalcomp (component);
-
- e_cal_backend_foreach_view (backend, component_created_cb, (gpointer) comp);
- g_object_unref (comp);
-}
-
-/**
- * e_cal_backend_notify_components_added:
- *
- * Like e_cal_backend_notify_objects_added() except take a list of
- * #icalcomponents instead of ical string representations and uses the
- * #EDataCalView's fields-of-interest to filter out unwanted information
- * from ical strings sent over the bus.
- *
- * Since: 3.4
- **/
-void
-e_cal_backend_notify_components_added (ECalBackend *backend,
- EDataCalView *view,
- const GSList *objects)
-{
- e_data_cal_view_notify_components_added (view, objects);
+ e_cal_backend_foreach_view (backend, component_created_cb, component);
}
static void
match_view_and_notify_component (EDataCalView *view,
ECalComponent *old_component,
- ECalComponent *component)
+ ECalComponent *new_component)
{
gboolean old_match = FALSE, new_match = FALSE;
- icalcomponent *icalcomp;
if (old_component)
old_match = e_data_cal_view_component_matches (view, old_component);
- new_match = e_data_cal_view_component_matches (view, component);
- icalcomp = e_cal_component_get_icalcomponent (component);
+ new_match = e_data_cal_view_component_matches (view, new_component);
if (old_match && new_match)
- e_data_cal_view_notify_components_modified_1 (view, icalcomp);
+ e_data_cal_view_notify_components_modified_1 (view, new_component);
else if (new_match)
- e_data_cal_view_notify_components_added_1 (view, icalcomp);
+ e_data_cal_view_notify_components_added_1 (view, new_component);
else if (old_match) {
ECalComponentId *id = e_cal_component_get_id (old_component);
struct component_call_data {
ECalComponent *old_component;
- ECalComponent *component;
+ ECalComponent *new_component;
const ECalComponentId *id;
};
g_return_val_if_fail (user_data != NULL, FALSE);
- match_view_and_notify_component (view, cd->old_component, cd->component);
+ match_view_and_notify_component (view, cd->old_component, cd->new_component);
return TRUE;
}
/**
* e_cal_backend_notify_component_modified:
* @backend: an #ECalBackend
- * @old_component: the #icalcomponent before the modification
- * @new_component: the #icalcomponent after the modification
+ * @old_component: the #ECalComponent before the modification
+ * @new_component: the #ECalComponent after the modification
*
* Notifies each of the backend's listeners about a modified object.
*
- * Like e_cal_backend_notify_object_modified() except takes an #icalcomponent
+ * Like e_cal_backend_notify_object_modified() except takes an #ECalComponent
* instead of an ical string representation and uses the #EDataCalView's
* fields-of-interest to filter out unwanted information from ical strings
* sent over the bus.
**/
void
e_cal_backend_notify_component_modified (ECalBackend *backend,
- const icalcomponent *old_component,
- const icalcomponent *new_component)
+ /* const */ ECalComponent *old_component,
+ /* const */ ECalComponent *new_component)
{
ECalBackendPrivate *priv;
struct component_call_data cd;
return;
}
- cd.old_component = ecal_comp_from_icalcomp (old_component);
- cd.component = ecal_comp_from_icalcomp (new_component);
+ cd.old_component = old_component;
+ cd.new_component = new_component;
cd.id = NULL;
e_cal_backend_foreach_view (backend, call_match_and_notify_component, &cd);
-
- if (cd.old_component)
- g_object_unref (cd.old_component);
-
- if (cd.component)
- g_object_unref (cd.component);
-}
-
-/**
- * e_cal_backend_notify_components_modified:
- *
- * Like e_cal_backend_notify_objects_modified() except takes a list of
- * #icalcomponents instead of a ical string representations and uses the
- * #EDataCalView's fields-of-interest to filter out unwanted information
- * from ical strings sent over the bus.
- *
- * Since: 3.4
- **/
-void
-e_cal_backend_notify_components_modified (ECalBackend *backend,
- EDataCalView *view,
- const GSList *objects)
-{
- e_data_cal_view_notify_components_modified (view, objects);
}
static gboolean
g_return_val_if_fail (user_data != NULL, FALSE);
- if (cd->component == NULL) {
+ if (cd->new_component == NULL) {
/* if object == NULL, it means the object has been completely
* removed from the backend */
if (!cd->old_component || e_data_cal_view_component_matches (view, cd->old_component))
e_data_cal_view_notify_objects_removed_1 (view, cd->id);
} else
- match_view_and_notify_component (view, cd->old_component, cd->component);
+ match_view_and_notify_component (view, cd->old_component, cd->new_component);
return TRUE;
}
* @backend: an #ECalBackend
* @id: the Id of the removed object
* @old_component: the removed component
- * @component: the component after the removal. This only applies to recurrent
+ * @new_component: the component after the removal. This only applies to recurrent
* appointments that had an instance removed. In that case, this function
* notifies a modification instead of a removal.
*
* Notifies each of the backend's listeners about a removed object.
*
- * Like e_cal_backend_notify_object_removed() except takes an #icalcomponent
+ * Like e_cal_backend_notify_object_removed() except takes an #ECalComponent
* instead of an ical string representation and uses the #EDataCalView's
* fields-of-interest to filter out unwanted information from ical strings
* sent over the bus.
void
e_cal_backend_notify_component_removed (ECalBackend *backend,
const ECalComponentId *id,
- const icalcomponent *old_component,
- const icalcomponent *component)
+ /* const */ ECalComponent *old_component,
+ /* const */ ECalComponent *new_component)
{
ECalBackendPrivate *priv;
struct component_call_data cd;
priv = backend->priv;
if (priv->notification_proxy) {
- e_cal_backend_notify_component_removed (priv->notification_proxy, id, old_component, component);
+ e_cal_backend_notify_component_removed (priv->notification_proxy, id, old_component, new_component);
return;
}
- cd.old_component = ecal_comp_from_icalcomp (old_component);
- cd.component = ecal_comp_from_icalcomp (component);
+ cd.old_component = old_component;
+ cd.new_component = new_component;
cd.id = id;
e_cal_backend_foreach_view (backend, component_removed_cb, &cd);
-
- if (cd.old_component)
- g_object_unref (cd.old_component);
-
- if (cd.component)
- g_object_unref (cd.component);
}
static gboolean
* #e_data_cal_notify_object_created() calls this for you. You only need to
* call e_cal_backend_notify_object_created() yourself to report objects
* created by non-EDS clients.
+ *
+ * Deprecated: 3.4: Use e_cal_backend_notify_component_created() instead.
**/
void
e_cal_backend_notify_object_created (ECalBackend *backend,
* e_cal_backend_notify_objects_added:
*
* Since: 2.24
+ *
+ * Deprecated: 3.4: Use e_data_cal_view_notify_objects_added() instead.
**/
void
e_cal_backend_notify_objects_added (ECalBackend *backend,
* #e_data_cal_notify_object_modified() calls this for you. You only need to
* call e_cal_backend_notify_object_modified() yourself to report objects
* modified by non-EDS clients.
+ *
+ * Deprecated: 3.4: Use e_cal_backend_notify_component_modified() instead.
**/
void
e_cal_backend_notify_object_modified (ECalBackend *backend,
* e_cal_backend_notify_objects_modified:
*
* Since: 2.24
+ *
+ * Deprecated: 3.4: Use e_data_cal_view_notify_objects_modified() instead.
**/
void
e_cal_backend_notify_objects_modified (ECalBackend *backend,
* e_data_cal_notify_object_removed() calls this for you. You only need to
* call e_cal_backend_notify_object_removed() yourself to report objects
* removed by non-EDS clients.
+ *
+ * Deprecated: 3.4: Use e_cal_backend_notify_component_removed() instead.
**/
void
e_cal_backend_notify_object_removed (ECalBackend *backend,
* e_cal_backend_notify_objects_removed:
*
* Since: 2.24
+ *
+ * Deprecated: 3.4: Use e_data_cal_view_notify_objects_removed() instead.
**/
void
e_cal_backend_notify_objects_removed (ECalBackend *backend,
comps_in_cache;
comps_in_cache = comps_in_cache->next) {
ECalComponentId *id;
- ECalComponent *comp = comps_in_cache->data;
- icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
+ ECalComponent *comp = comps_in_cache->data;
id = e_cal_component_get_id (comp);
e_cal_backend_cache_remove_component (cache, id->uid, id->rid);
- e_cal_backend_notify_component_removed (backend, id, icalcomp, NULL);
+ e_cal_backend_notify_component_removed (backend, id, comp, NULL);
e_cal_component_free_id (id);
g_object_unref (comp);
void e_cal_backend_start_view (ECalBackend *backend, EDataCalView *view);
void e_cal_backend_stop_view (ECalBackend *backend, EDataCalView *view);
-void e_cal_backend_notify_component_created (ECalBackend *backend, const icalcomponent *component);
-void e_cal_backend_notify_components_added (ECalBackend *backend, EDataCalView *view, const GSList *components);
-void e_cal_backend_notify_component_modified (ECalBackend *backend, const icalcomponent *old_component, const icalcomponent *new_component);
-void e_cal_backend_notify_components_modified (ECalBackend *backend, EDataCalView *view, const GSList *components);
-void e_cal_backend_notify_component_removed (ECalBackend *backend, const ECalComponentId *id, const icalcomponent *old_component, const icalcomponent *component);
-
+void e_cal_backend_notify_component_created (ECalBackend *backend,
+ /* const */ ECalComponent *component);
+void e_cal_backend_notify_component_modified (ECalBackend *backend,
+ /* const */ ECalComponent *old_component,
+ /* const */ ECalComponent *new_component);
+void e_cal_backend_notify_component_removed (ECalBackend *backend,
+ const ECalComponentId *id,
+ /* const */ ECalComponent *old_component,
+ /* const */ ECalComponent *new_component);
+
+#ifndef E_CAL_DISABLE_DEPRECATED
void e_cal_backend_notify_object_created (ECalBackend *backend, const gchar *calobj);
void e_cal_backend_notify_objects_added (ECalBackend *backend, EDataCalView *view, const GSList *objects);
void e_cal_backend_notify_object_modified (ECalBackend *backend, const gchar *old_object, const gchar *object);
void e_cal_backend_notify_objects_modified (ECalBackend *backend, EDataCalView *view, const GSList *objects);
void e_cal_backend_notify_object_removed (ECalBackend *backend, const ECalComponentId *id, const gchar *old_object, const gchar *new_object);
void e_cal_backend_notify_objects_removed (ECalBackend *backend, EDataCalView *view, const GSList *ids);
+#endif
void e_cal_backend_notify_error (ECalBackend *backend, const gchar *message);
void e_cal_backend_notify_readonly (ECalBackend *backend, gboolean is_readonly);
static void
notify_add_component (EDataCalView *view,
- icalcomponent *icalcomp)
+ /* const */ ECalComponent *comp)
{
EDataCalViewPrivate *priv = view->priv;
- icalcomponent *icalclone;
- ECalComponent *comp;
gchar *obj;
- obj = e_data_cal_view_get_component_string (view, icalcomp);
+ obj = e_data_cal_view_get_component_string (view, comp);
send_pending_changes (view);
send_pending_removes (view);
}
g_array_append_val (priv->adds, obj);
- comp = e_cal_component_new ();
- icalclone = icalcomponent_new_clone (icalcomp);
- e_cal_component_set_icalcomponent (comp, icalclone);
-
g_hash_table_insert (priv->ids,
e_cal_component_get_id (comp),
GUINT_TO_POINTER (1));
- g_object_unref (comp);
ensure_pending_flush_timeout (view);
}
static void
notify_change_component (EDataCalView *view,
- icalcomponent *comp)
+ ECalComponent *comp)
{
gchar *obj;
icalcomponent *icomp;
gboolean fail = FALSE;
+ g_return_val_if_fail (icomponent != NULL, FALSE);
+
/* Open iCalendar string */
g_string_append (string, "BEGIN:");
/**
* e_data_cal_view_get_component_string:
* @view: A view object.
- * @component: The #icalcomponent to get the string for.
+ * @component: The #ECalComponent to get the string for.
*
* This function is similar to e_cal_component_get_as_string() except
* that it takes into account the fields-of-interest that @view is
*/
gchar *
e_data_cal_view_get_component_string (EDataCalView *view,
- icalcomponent *component)
+ /* const */ ECalComponent *component)
{
g_return_val_if_fail (E_IS_DATA_CAL_VIEW (view), NULL);
g_return_val_if_fail (component != NULL, NULL);
if (view->priv->fields_of_interest) {
GString *string = g_string_new ("");
+ icalcomponent *icalcomp = e_cal_component_get_icalcomponent (component);
- if (filter_component (component, view->priv->fields_of_interest, string))
+ if (filter_component (icalcomp, view->priv->fields_of_interest, string))
return g_string_free (string, FALSE);
g_string_free (string, TRUE);
}
- return icalcomponent_as_ical_string_r (component);
+ return e_cal_component_get_as_string (component);
}
/**
* e_data_cal_view_notify_components_added:
* @view: A view object.
- * @components: List of components that have been added.
+ * @ecalcomponents: List of #ECalComponent-s that have been added.
*
* Notifies all view listeners of the addition of a list of components.
*
* Like e_data_cal_view_notify_objects_added() except takes a list
- * of #icalcomponents instead of ical string representations and uses the
+ * of #ECalComponent-s instead of ical string representations and uses the
* #EDataCalView's fields-of-interest to filter out unwanted information
* from ical strings sent over the bus.
*
*/
void
e_data_cal_view_notify_components_added (EDataCalView *view,
- const GSList *components)
+ const GSList *ecalcomponents)
{
EDataCalViewPrivate *priv;
const GSList *l;
g_return_if_fail (view && E_IS_DATA_CAL_VIEW (view));
priv = view->priv;
- if (components == NULL)
+ if (ecalcomponents == NULL)
return;
g_mutex_lock (priv->pending_mutex);
- for (l = components; l; l = l->next) {
- icalcomponent *comp = l->data;
+ for (l = ecalcomponents; l; l = l->next) {
+ ECalComponent *comp = l->data;
+
+ g_warn_if_fail (E_IS_CAL_COMPONENT (comp));
notify_add_component (view, comp);
}
/**
* e_data_cal_view_notify_components_added_1:
* @view: A view object.
- * @component: The #icalcomponent that has been added.
+ * @component: The #ECalComponent that has been added.
*
* Notifies all the view listeners of the addition of a single object.
*
- * Like e_data_cal_view_notify_objects_added_1() except takes an #icalcomponent
+ * Like e_data_cal_view_notify_objects_added_1() except takes an #ECalComponent
* instead of an ical string representation and uses the #EDataCalView's
* fields-of-interest to filter out unwanted information from ical strings
* sent over the bus.
*/
void
e_data_cal_view_notify_components_added_1 (EDataCalView *view,
- const icalcomponent *component)
+ /* const */ ECalComponent *component)
{
GSList l = {NULL,};
/**
* e_data_cal_view_notify_components_modified:
* @view: A view object.
- * @components: List of modified components.
+ * @ecalcomponents: List of modified #ECalComponent-s.
*
* Notifies all view listeners of the modification of a list of components.
*
* Like e_data_cal_view_notify_objects_modified() except takes a list of
- * #icalcomponents instead of a ical string representations and uses the
+ * #ECalComponents instead of a ical string representations and uses the
* #EDataCalView's fields-of-interest to filter out unwanted information
* from ical strings sent over the bus.
*
*/
void
e_data_cal_view_notify_components_modified (EDataCalView *view,
- const GSList *components)
+ const GSList *ecalcomponents)
{
EDataCalViewPrivate *priv;
const GSList *l;
g_return_if_fail (view && E_IS_DATA_CAL_VIEW (view));
priv = view->priv;
- if (components == NULL)
+ if (ecalcomponents == NULL)
return;
g_mutex_lock (priv->pending_mutex);
- for (l = components; l; l = l->next) {
- /* TODO: send add/remove/change as relevant, based on ->ids */
- icalcomponent *comp = l->data;
+ for (l = ecalcomponents; l; l = l->next) {
+ ECalComponent *comp = l->data;
+
+ g_warn_if_fail (E_IS_CAL_COMPONENT (comp));
notify_change_component (view, comp);
}
/**
* e_data_cal_view_notify_components_modified_1:
* @view: A view object.
- * @component: The modified #icalcomponent.
+ * @component: The modified #ECalComponent.
*
* Notifies all view listeners of the modification of @component.
*
* Like e_data_cal_view_notify_objects_modified_1() except takes an
- * #icalcomponent instead of an ical string representation and uses the
+ * #ECalComponent instead of an ical string representation and uses the
* #EDataCalView's fields-of-interest to filter out unwanted information
* from ical strings sent over the bus.
*
*/
void
e_data_cal_view_notify_components_modified_1 (EDataCalView *view,
- const icalcomponent *component)
+ /* const */ ECalComponent *component)
{
GSList l = {NULL,};
*
* Notifies all view listeners of the addition of a list of objects.
*
- * If possible e_data_cal_view_notify_components_added() should be used
- * instead.
+ * Deprecated: 3.4: If possible e_data_cal_view_notify_components_added()
+ * should be used instead.
*/
void
e_data_cal_view_notify_objects_added (EDataCalView *view,
*
* Notifies all the view listeners of the addition of a single object.
*
- * If possible e_data_cal_view_notify_components_added_1() should be used
- * instead.
+ * Deprecated: 3.4: If possible e_data_cal_view_notify_components_added_1()
+ * should be used instead.
*/
void
e_data_cal_view_notify_objects_added_1 (EDataCalView *view,
*
* Notifies all view listeners of the modification of a list of objects.
*
- * If possible e_data_cal_view_notify_components_modified() should be used
- * instead.
+ * Deprecated: 3.4: If possible e_data_cal_view_notify_components_modified()
+ * should be used instead.
*/
void
e_data_cal_view_notify_objects_modified (EDataCalView *view,
*
* Notifies all view listeners of the modification of a single object.
*
- * If possible e_data_cal_view_notify_components_modified_1() should be used
- * instead.
+ * Deprecated: 3.4: If possible e_data_cal_view_notify_components_modified_1()
+ * should be used instead.
*/
void
e_data_cal_view_notify_objects_modified_1 (EDataCalView *view,
gboolean e_data_cal_view_is_stopped (EDataCalView *view);
GHashTable * e_data_cal_view_get_fields_of_interest (EDataCalView *view);
-gchar *e_data_cal_view_get_component_string (EDataCalView *view, icalcomponent *component);
+gchar * e_data_cal_view_get_component_string (EDataCalView *view, /* const */ ECalComponent *component);
-void e_data_cal_view_notify_components_added (EDataCalView *view, const GSList *components);
-void e_data_cal_view_notify_components_added_1 (EDataCalView *view, const icalcomponent *component);
-void e_data_cal_view_notify_components_modified (EDataCalView *view, const GSList *components);
-void e_data_cal_view_notify_components_modified_1 (EDataCalView *view, const icalcomponent *component);
+void e_data_cal_view_notify_components_added (EDataCalView *view, const GSList *ecalcomponents);
+void e_data_cal_view_notify_components_added_1 (EDataCalView *view, /* const */ ECalComponent *component);
+void e_data_cal_view_notify_components_modified (EDataCalView *view, const GSList *ecalcomponents);
+void e_data_cal_view_notify_components_modified_1 (EDataCalView *view, /* const */ ECalComponent *component);
+#ifndef E_CAL_DISABLE_DEPRECATED
void e_data_cal_view_notify_objects_added (EDataCalView *view, const GSList *objects);
void e_data_cal_view_notify_objects_added_1 (EDataCalView *view, const gchar *object);
void e_data_cal_view_notify_objects_modified (EDataCalView *view, const GSList *objects);
void e_data_cal_view_notify_objects_modified_1 (EDataCalView *view, const gchar *object);
+#endif
+
void e_data_cal_view_notify_objects_removed (EDataCalView *view, const GSList *ids);
void e_data_cal_view_notify_objects_removed_1 (EDataCalView *view, const ECalComponentId *id);
void e_data_cal_view_notify_progress (EDataCalView *view, gint percent, const gchar *message);
* @cal: A calendar client interface.
* @error: Operation error, if any, automatically freed if passed it.
* @uid: UID of the object created.
- * @component: The newly created #icalcomponent.
+ * @new_component: The newly created #ECalComponent.
*
* Notifies listeners of the completion of the create_object method call.
*
guint32 opid,
GError *error,
const gchar *uid,
- icalcomponent *component)
+ /* const */ ECalComponent *new_component)
{
gchar *gdbus_uid = NULL;
if (error)
g_error_free (error);
else
- e_cal_backend_notify_component_created (cal->priv->backend, component);
+ e_cal_backend_notify_component_created (cal->priv->backend, new_component);
}
/**
* e_data_cal_respond_modify_object:
* @cal: A calendar client interface.
* @error: Operation error, if any, automatically freed if passed it.
- * @old_component: The old #icalcomponent.
- * @component: The new #icalcomponent.
+ * @old_component: The old #ECalComponent.
+ * @new_component: The new #ECalComponent.
*
* Notifies listeners of the completion of the modify_object method call.
*
e_data_cal_respond_modify_object (EDataCal *cal,
guint32 opid,
GError *error,
- icalcomponent *old_component,
- icalcomponent *component)
+ /* const */ ECalComponent *old_component,
+ /* const */ ECalComponent *new_component)
{
op_complete (cal, opid);
if (error)
g_error_free (error);
else
- e_cal_backend_notify_component_modified (cal->priv->backend, old_component, component);
+ e_cal_backend_notify_component_modified (cal->priv->backend, old_component, new_component);
}
/**
* @cal: A calendar client interface.
* @error: Operation error, if any, automatically freed if passed it.
* @id: ID of the removed object.
- * @old_component: The old #icalcomponent.
- * @component: The new #icalcomponent. This will not be NULL only
+ * @old_component: The old #ECalComponent.
+ * @new_component: The new #ECalComponent. This will not be NULL only
* when removing instances of a recurring appointment.
*
* Notifies listeners of the completion of the remove_object method call.
guint32 opid,
GError *error,
const ECalComponentId *id,
- icalcomponent *old_component,
- icalcomponent *component)
+ /* const */ ECalComponent *old_component,
+ /* const */ ECalComponent *new_component)
{
op_complete (cal, opid);
if (error)
g_error_free (error);
else
- e_cal_backend_notify_component_removed (cal->priv->backend, id, old_component, component);
+ e_cal_backend_notify_component_removed (cal->priv->backend, id, old_component, new_component);
}
/**
void e_data_cal_respond_get_object (EDataCal *cal, guint32 opid, GError *error, const gchar *object);
void e_data_cal_respond_get_object_list (EDataCal *cal, guint32 opid, GError *error, const GSList *objects);
void e_data_cal_respond_get_free_busy (EDataCal *cal, guint32 opid, GError *error);
-void e_data_cal_respond_create_object (EDataCal *cal, guint32 opid, GError *error, const gchar *uid, icalcomponent *component);
-void e_data_cal_respond_modify_object (EDataCal *cal, guint32 opid, GError *error, icalcomponent *old_component, icalcomponent *component);
-void e_data_cal_respond_remove_object (EDataCal *cal, guint32 opid, GError *error, const ECalComponentId *id, icalcomponent *old_component, icalcomponent *component);
+void e_data_cal_respond_create_object (EDataCal *cal, guint32 opid, GError *error, const gchar *uid, /*const */ ECalComponent *new_component);
+void e_data_cal_respond_modify_object (EDataCal *cal, guint32 opid, GError *error, /* const */ ECalComponent *old_component, /* const */ ECalComponent *new_component);
+void e_data_cal_respond_remove_object (EDataCal *cal, guint32 opid, GError *error, const ECalComponentId *id, /* const */ ECalComponent *old_component, /* const */ ECalComponent *new_component);
void e_data_cal_respond_receive_objects (EDataCal *cal, guint32 opid, GError *error);
void e_data_cal_respond_send_objects (EDataCal *cal, guint32 opid, GError *error, const GSList *users, const gchar *calobj);
void e_data_cal_respond_get_attachment_uris (EDataCal *cal, guint32 opid, GError *error, const GSList *attachment_uris);
LIBECAL_REVISION=2
LIBECAL_AGE=2
-LIBEDATACAL_CURRENT=14
+LIBEDATACAL_CURRENT=15
LIBEDATACAL_REVISION=0
LIBEDATACAL_AGE=0