From 7c0907172f5dfef27b188a745f0525a76f1fa5b8 Mon Sep 17 00:00:00 2001 From: Veerapuram Varadhan Date: Fri, 30 Sep 2005 17:13:04 +0000 Subject: Fixes #303702 Call e_cal_component_commit_sequence() after modifying the Fixes #303702 * calendar/conduits/calendar/calendar-conduit.c: (process_multi_day): Call e_cal_component_commit_sequence() after modifying the properties of an ECalComponent and before fetching its icalcomponent. Reworked the patch from Dave Malcolm svn path=/trunk/; revision=30453 --- calendar/ChangeLog | 10 ++++++++++ calendar/conduits/calendar/calendar-conduit.c | 16 ++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index c8072916f7..ef0c1b91f0 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,13 @@ +2005-09-30 Veerapuram Varadhan + + Fixes #303702 + * calendar/conduits/calendar/calendar-conduit.c: + (process_multi_day): Call e_cal_component_commit_sequence() after + modifying the properties of an ECalComponent and before fetching + its icalcomponent. + + Reworked the patch from Dave Malcolm + 2005-09-30 Viren.L Fixes #258786 diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c index d84fb72e83..f58d56c13d 100644 --- a/calendar/conduits/calendar/calendar-conduit.c +++ b/calendar/conduits/calendar/calendar-conduit.c @@ -616,9 +616,10 @@ process_multi_day (ECalConduitContext *ctxt, ECalChange *ccc, GList **multi_comp old_end_value = dt_end.value; while (!last) { ECalComponent *clone = e_cal_component_clone (ccc->comp); + icalcomponent *ical_comp = NULL; char *new_uid = e_cal_component_gen_uid (); struct icaltimetype start_value, end_value; - ECalChange *c = g_new0 (ECalChange, 1); + ECalChange *c = NULL; if (day_end >= event_end) { day_end = event_end; @@ -635,9 +636,20 @@ process_multi_day (ECalConduitContext *ctxt, ECalChange *ccc, GList **multi_comp dt_end.value = &end_value; e_cal_component_set_dtend (clone, &dt_end); + e_cal_component_commit_sequence (clone); + /* FIXME Error handling */ - e_cal_create_object (ctxt->client, e_cal_component_get_icalcomponent (clone), NULL, NULL); + ical_comp = e_cal_component_get_icalcomponent (clone); + if (!ical_comp) { + ret = FALSE; + g_free (new_uid); + g_object_unref (clone); + goto cleanup; + } + + e_cal_create_object (ctxt->client, ical_comp, NULL, NULL); + c = g_new0 (ECalChange, 1); c->comp = clone; c->type = E_CAL_CHANGE_ADDED; -- cgit v1.2.3