summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpschwabauer <pschwabauer@intevation.de>2024-02-12 09:04:57 +0100
committerpschwabauer <pschwabauer@intevation.de>2024-02-12 12:29:58 +0100
commitcf6c82feb822a95d66ef0c6e29a83e33485e41b5 (patch)
tree79aca99dfd407b63f451521359ae3c1d69064ea7
parent33ffa952335f63ccaacd90dd611c6d5896412c53 (diff)
downloadtdepim-cf6c82feb822a95d66ef0c6e29a83e33485e41b5.tar.gz
tdepim-cf6c82feb822a95d66ef0c6e29a83e33485e41b5.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>
-rw-r--r--libkcal/icalformatimpl.cpp15
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);
}