diff options
author | pschwabauer <pschwabauer@intevation.de> | 2024-02-12 09:04:57 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2024-02-12 12:57:37 +0100 |
commit | ea84f5748b111966fc9f9cd271401e4f104994bb (patch) | |
tree | d2844d22d62778ddd7ab4ebafedba45f2ff7b72c | |
parent | 112a9744d3683c34be761331465c8505618ea9ef (diff) | |
download | tdepim-ea84f5748b111966fc9f9cd271401e4f104994bb.tar.gz tdepim-ea84f5748b111966fc9f9cd271401e4f104994bb.zip |
Fix spurious quotes in calendar events
Newer libical versions no longer require the parameters to be quoted. This
patch removes the quoting to avoid adding unnecessary quotes to the
attendee and organizer parameters. This resolves issue #108.
Signed-off-by: pschwabauer <pschwabauer@intevation.de>
(cherry picked from commit cf6c82feb822a95d66ef0c6e29a83e33485e41b5)
-rw-r--r-- | libkcal/icalformatimpl.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index e4296bcec..d8fe62df0 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp @@ -69,15 +69,6 @@ static void _dumpIcaltime( const icaltimetype& t) } */ -static TQString quoteForParam( const TQString &text ) -{ - TQString tmp = text; - tmp.remove( '"' ); - if ( tmp.contains( ';' ) || tmp.contains( ':' ) || tmp.contains( ',' ) ) - return tmp; // libical quotes in this case already, see icalparameter_as_ical_string() - return TQString::fromLatin1( "\"" ) + tmp + TQString::fromLatin1( "\"" ); -} - const int gSecondsPerMinute = 60; const int gSecondsPerHour = gSecondsPerMinute * 60; const int gSecondsPerDay = gSecondsPerHour * 24; @@ -576,7 +567,7 @@ icalproperty *ICalFormatImpl::writeOrganizer( const Person &organizer ) icalproperty *p = icalproperty_new_organizer("MAILTO:" + organizer.email().utf8()); if (!organizer.name().isEmpty()) { - icalproperty_add_parameter( p, icalparameter_new_cn(quoteForParam(organizer.name()).utf8()) ); + icalproperty_add_parameter( p, icalparameter_new_cn(organizer.name().utf8()) ); } // TODO: Write dir, sent-by and language @@ -589,7 +580,7 @@ icalproperty *ICalFormatImpl::writeAttendee(Attendee *attendee) icalproperty *p = icalproperty_new_attendee("mailto:" + attendee->email().utf8()); if (!attendee->name().isEmpty()) { - icalproperty_add_parameter(p,icalparameter_new_cn(quoteForParam(attendee->name()).utf8())); + icalproperty_add_parameter(p,icalparameter_new_cn(attendee->name().utf8())); } @@ -869,7 +860,7 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm) for (TQValueList<Person>::Iterator ad = addresses.begin(); ad != addresses.end(); ++ad) { icalproperty *p = icalproperty_new_attendee("MAILTO:" + (*ad).email().utf8()); if (!(*ad).name().isEmpty()) { - icalproperty_add_parameter(p,icalparameter_new_cn(quoteForParam((*ad).name()).utf8())); + icalproperty_add_parameter(p,icalparameter_new_cn((*ad).name().utf8())); } icalcomponent_add_property(a,p); } |