From 24f0de634028297d3647779cffa082f8ff6a230a Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Sat, 18 Apr 1998 21:37:45 +0000 Subject: Add Quoted printable property to items containing new lines. (duration): 1998-04-18 Miguel de Icaza * calobj.c (ical_object_to_vobject): Add Quoted printable property to items containing new lines. (duration): Use unsigned integers, to work around buggy calendar files generated by korganizer. * main.c (save_calendar_cmd): Do not ask for file name if we are saving. (save_as_calendar_cmd): New command. svn path=/trunk/; revision=158 --- calendar/pcs/calobj.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'calendar/pcs/calobj.c') diff --git a/calendar/pcs/calobj.c b/calendar/pcs/calobj.c index 4624b3a485..d9950e0bae 100644 --- a/calendar/pcs/calobj.c +++ b/calendar/pcs/calobj.c @@ -303,7 +303,7 @@ load_recur_yearly_day (iCalObject *o, char **str) static void duration (iCalObject *o, char **str) { - int duration = 0; + unsigned int duration = 0; ignore_space (str); if (**str != '#') @@ -735,7 +735,7 @@ save_alarm (VObject *o, CalendarAlarm *alarm, iCalObject *ical) VObject * ical_object_to_vobject (iCalObject *ical) { - VObject *o, *alarm; + VObject *o, *alarm, *s; GList *l; if (ical->type == ICAL_EVENT) @@ -757,7 +757,7 @@ ical_object_to_vobject (iCalObject *ical) addPropValue (o, VCDTendProp, isodate_from_time_t (ical->dtend)); /* dcreated */ - addPropValue (o, VCDTendProp, isodate_from_time_t (ical->created)); + addPropValue (o, VCDCreatedProp, isodate_from_time_t (ical->created)); /* completed */ if (ical->completed) @@ -771,11 +771,20 @@ ical_object_to_vobject (iCalObject *ical) store_list (o, VCExpDateProp, ical->exdate, ','); /* description/comment */ - addPropValue (o, VCDescriptionProp, ical->comment ? ical->comment : "No Comment"); + if (ical->comment && strlen (ical->comment)){ + s = addPropValue (o, VCDescriptionProp, ical->comment); + if (strchr (ical->comment, '\n')) + addProp (s, VCQuotedPrintableProp); + } /* summary */ - if (ical->summary) - addPropValue (o, VCSummaryProp, ical->summary); + if (strlen (ical->summary)){ + s = addPropValue (o, VCSummaryProp, ical->summary); + if (strchr (ical->summary, '\n')) + addProp (s, VCQuotedPrintableProp); + } else { + addPropValue (o, VCSummaryProp, _("Appointment")); + } /* status */ addPropValue (o, VCStatusProp, ical->status); -- cgit v1.2.3