Commit 309ea399 authored by Laurent Montel's avatar Laurent Montel 😁

Fix Bug 365193 - vCard4 export must use RELATED field instead of custom X- field

FIXED-IN: 5.3
BUG: 365193
parent a5b56bd7
...@@ -97,6 +97,7 @@ void CustomIdentifierTest::shouldExportVcard4() ...@@ -97,6 +97,7 @@ void CustomIdentifierTest::shouldExportVcard4()
"EMAIL:foo@kde.org\r\n" "EMAIL:foo@kde.org\r\n"
"EMAIL:bla@kde.org\r\n" "EMAIL:bla@kde.org\r\n"
"N:;;;;\r\n" "N:;;;;\r\n"
"RELATED;TYPE=spouse:;\r\n"
"UID:testuid\r\n" "UID:testuid\r\n"
"END:VCARD\r\n\r\n"); "END:VCARD\r\n\r\n");
...@@ -113,6 +114,7 @@ void CustomIdentifierTest::shouldExportVcard4() ...@@ -113,6 +114,7 @@ void CustomIdentifierTest::shouldExportVcard4()
"EMAIL:foo@kde.org\r\n" "EMAIL:foo@kde.org\r\n"
"EMAIL:bla@kde.org\r\n" "EMAIL:bla@kde.org\r\n"
"N:;;;;\r\n" "N:;;;;\r\n"
"RELATED;TYPE=spouse:;\r\n"
"UID:testuid\r\n" "UID:testuid\r\n"
"END:VCARD\r\n\r\n"); "END:VCARD\r\n\r\n");
......
...@@ -608,7 +608,7 @@ QByteArray VCardTool::createVCards(const Addressee::List &list, ...@@ -608,7 +608,7 @@ QByteArray VCardTool::createVCards(const Addressee::List &list,
} }
} else if (identifier.toLower() == QLatin1String("x-kaddressbook-x-spousesname") && version == VCard::v4_0) { } else if (identifier.toLower() == QLatin1String("x-kaddressbook-x-spousesname") && version == VCard::v4_0) {
if (!value.isEmpty()) { if (!value.isEmpty()) {
VCardLine line( QStringLiteral("RELATED")); VCardLine line( QStringLiteral("RELATED"),QStringLiteral(";"));
line.addParameter(QStringLiteral("TYPE"), QStringLiteral("spouse")); line.addParameter(QStringLiteral("TYPE"), QStringLiteral("spouse"));
qDebug()<<" line valid"<<line.value(); qDebug()<<" line valid"<<line.value();
card.addLine(line); card.addLine(line);
......
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