diff options
Diffstat (limited to 'calendar/conduits/calendar/calendar-conduit.c')
-rw-r--r-- | calendar/conduits/calendar/calendar-conduit.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c index 0171ea4b70..1893e6b34c 100644 --- a/calendar/conduits/calendar/calendar-conduit.c +++ b/calendar/conduits/calendar/calendar-conduit.c @@ -1006,13 +1006,21 @@ local_record_from_uid (ECalLocalRecord *local, ECalConduitContext *ctxt) { CalComponent *comp; + icalcomponent *icalcomp; CalClientGetStatus status; g_assert(local!=NULL); - status = cal_client_get_object (ctxt->client, uid, &comp); + status = cal_client_get_object (ctxt->client, uid, &icalcomp); if (status == CAL_CLIENT_GET_SUCCESS) { + comp = cal_component_new (); + if (!cal_component_set_icalcomponent (comp, icalcomp)) { + g_object_unref (comp); + icalcomponent_free (icalcomp); + return; + } + local_record_from_comp (local, comp, ctxt); g_object_unref (comp); } else if (status == CAL_CLIENT_GET_NOT_FOUND) { @@ -1328,6 +1336,7 @@ pre_sync (GnomePilotConduit *conduit, int len; unsigned char *buf; char *filename, *change_id; + icalcomponent *icalcomp; gint num_records, add_records = 0, mod_records = 0, del_records = 0; abs_conduit = GNOME_PILOT_CONDUIT_SYNC_ABS (conduit); @@ -1355,9 +1364,16 @@ pre_sync (GnomePilotConduit *conduit, cal_client_set_default_timezone (ctxt->client, ctxt->timezone); /* Get the default component */ - if (cal_client_get_default_object (ctxt->client, CALOBJ_TYPE_EVENT, &ctxt->default_comp) != CAL_CLIENT_GET_SUCCESS) + if (cal_client_get_default_object (ctxt->client, CALOBJ_TYPE_EVENT, &icalcomp) != CAL_CLIENT_GET_SUCCESS) return -1; + ctxt->default_comp = cal_component_new (); + if (!cal_component_set_icalcomponent (ctxt->default_comp, icalcomp)) { + g_object_unref (ctxt->default_comp); + icalcomponent_free (icalcomp); + return -1; + } + /* Load the uid <--> pilot id mapping */ filename = map_name (ctxt); e_pilot_map_read (filename, &ctxt->map); |