gboolean evo_cal_source_update_object(ECal *ecal, ECalComponent *obj) { if (!e_cal_modify_object (ecal, e_cal_component_get_icalcomponent(obj), CALOBJ_MOD_ALL, NULL)) return FALSE; return TRUE; }
void dates_commit_event_cb (GtkWidget *source, DatesData *data, CalObjModType type) { /* Commit changes */ #ifdef DEBUG if (data->debug & DATES_DEBUG_EDIT) g_debug ("Committing event (%p) changes", data->comp); #endif e_cal_component_commit_sequence (data->comp); e_cal_modify_object (data->cal, e_cal_component_get_icalcomponent (data->comp), type, NULL); }
static const gchar * test_object_modification (ECal *client, gchar *uid) { const gchar *summary = "This summary was modified"; icalcomponent *icalcomp, *icalcomp_modified; gboolean compare; GError *error = NULL; if (!e_cal_get_object (client, uid, NULL, &icalcomp, &error)) { cl_printf (client, "Test Modify object : Could not get the object: %s\n", error->message); g_free (uid); return error->message; } /* Modify one property of the icalcomp and save it. * Now retrieve it and check the field. */ icalcomponent_set_summary (icalcomp, summary); if (!e_cal_modify_object (client, icalcomp, CALOBJ_MOD_THIS, &error)) { cl_printf (client, "Test Modify object : Could not modify the object: %s\n", error->message); g_free (uid); g_free (icalcomp); return error->message; } if (!e_cal_get_object (client, uid, NULL, &icalcomp_modified, &error)) { cl_printf (client, "Test Modify object : Could not get the modified object: %s\n", error->message); g_free (uid); g_free (icalcomp); return "Test Object Creation failed"; } compare = !strcmp ( icalcomponent_get_summary (icalcomp_modified), summary); g_free (uid); g_free (icalcomp); g_free (icalcomp_modified); mu_assert ("Test Modify object : Modification failed\n", compare); return NULL; }
static gint replace_record (GnomePilotConduitSyncAbs *conduit, EMemoLocalRecord *local, GnomePilotRecord *remote, EMemoConduitContext *ctxt) { ECalComponent *new_comp; int retval = 0; g_return_val_if_fail (remote != NULL, -1); LOG (g_message ("replace_record: replace %s with %s\n", print_local (local), print_remote (remote))); new_comp = comp_from_remote_record (conduit, remote, local->comp, ctxt->timezone, &(ctxt->ai)); g_object_unref (local->comp); local->comp = new_comp; if (!e_cal_modify_object (ctxt->client, e_cal_component_get_icalcomponent (new_comp), CALOBJ_MOD_ALL, NULL)) return -1; return retval; }