Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit b1772c49 authored by Laurent Montel's avatar Laurent Montel 😁

Allow to load ANNIVERSARY (vcard4.0)

parent 1d09fdf8
......@@ -563,7 +563,12 @@ Addressee::List VCardTool::parseVCards( const QByteArray &vcard ) const
else if ( identifier == QLatin1String( "bday" ) ) {
addr.setBirthday( parseDateTime( ( *lineIt ).value().toString() ) );
}
// ANNIVERSARY
else if ( identifier == QLatin1String( "anniversary" ) ) {
const QString t = ( *lineIt ).value().toString();
const QDateTime dt(parseDateTime( t ));
addr.insertCustom( QLatin1String("KADDRESSBOOK"), QLatin1String("X-Anniversary"), dt.date().toString(Qt::ISODate) );
}
// CATEGORIES
else if ( identifier == QLatin1String( "categories" ) ) {
const QStringList categories = splitString( commaSep, ( *lineIt ).value().toString() );
......@@ -866,7 +871,6 @@ QDateTime VCardTool::parseDateTime( const QString &str ) const
date = QDate( str.left( 4 ).toInt(), str.mid( 5, 2 ).toInt(),
str.mid( 8, 2 ).toInt() );
}
// does it also contain a time ? (Note: mm, ss are optional according ISO-8601)
int timeStart = str.indexOf( QLatin1Char( 'T' ) );
if ( timeStart >= 0 ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment