From 46d815d3dcf5f289aadbcae47c9b416fdded09cc Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Tue, 24 Sep 2002 14:32:58 +0000 Subject: make sure the start/end for no time palm events are DATE values, tidy code 2002-09-24 JP Rosevear * conduits/calendar/calendar-conduit.c (comp_from_remote_record): make sure the start/end for no time palm events are DATE values, tidy code slightly svn path=/trunk/; revision=18199 --- calendar/conduits/calendar/calendar-conduit.c | 31 ++++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'calendar/conduits') diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c index d057ed49fe..dac3d7cf55 100644 --- a/calendar/conduits/calendar/calendar-conduit.c +++ b/calendar/conduits/calendar/calendar-conduit.c @@ -938,7 +938,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, struct icaltimetype now = icaltime_from_timet_with_zone (time (NULL), FALSE, timezone), it; struct icalrecurrencetype recur; CalComponentText summary = {NULL, NULL}; - CalComponentDateTime dt = {NULL, icaltimezone_get_tzid (timezone)}; + CalComponentDateTime dt = {NULL, NULL}; GSList *edl = NULL; char *txt; int pos, i; @@ -978,21 +978,26 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, free (txt); } - if (!is_empty_time (appt.begin)) { - it = tm_to_icaltimetype (&appt.begin, FALSE); + if (appt.event && !is_empty_time (appt.begin)) { + it = tm_to_icaltimetype (&appt.begin, TRUE); dt.value = ⁢ + dt.tzid = NULL; cal_component_set_dtstart (comp, &dt); - } - - if (appt.event) { - it = tm_to_icaltimetype (&appt.begin, FALSE); - icaltime_adjust (&it, 1, 0, 0, 0); - dt.value = ⁢ - cal_component_set_dtend (comp, &dt); - } else if (!is_empty_time (appt.end)) { - it = tm_to_icaltimetype (&appt.end, FALSE); - dt.value = ⁢ cal_component_set_dtend (comp, &dt); + } else { + dt.tzid = icaltimezone_get_tzid (timezone); + + if (!is_empty_time (appt.begin)) { + it = tm_to_icaltimetype (&appt.begin, FALSE); + dt.value = ⁢ + cal_component_set_dtstart (comp, &dt); + } + + if (!is_empty_time (appt.end)) { + it = tm_to_icaltimetype (&appt.end, FALSE); + dt.value = ⁢ + cal_component_set_dtend (comp, &dt); + } } /* Recurrence information */ -- cgit v1.2.3