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

Try to understand why autotest is not good

parent a9b75538
......@@ -102,18 +102,18 @@ void CustomIdentifierTest::shouldExportVcard4()
QCOMPARE(ba, expected);
addr.insertCustom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("X-ANNIVERSARY"), QStringLiteral("19960415"));
QDate dt(12, 9, 3);
addr.insertCustom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("X-ANNIVERSARY"), dt.toString(Qt::ISODate));
lst.clear();
lst << addr;
ba = vcard.exportVCards(lst, KContacts::VCard::v4_0);
expected = QByteArray("BEGIN:VCARD\r\n"
"VERSION:4.0\r\n"
"ANNIVERSARY: 120903T000000\r\n"
"EMAIL:foo@kde.org\r\n"
"EMAIL:bla@kde.org\r\n"
"N:;;;;\r\n"
"UID:testuid\r\n"
"X-KADDRESSBOOK-X-ANNIVERSARY:19960415\r\n"
"X-KADDRESSBOOK-X-SpousesName:foo\r\n"
"END:VCARD\r\n\r\n");
QCOMPARE(ba, expected);
......
......@@ -603,12 +603,14 @@ QByteArray VCardTool::createVCards(const Addressee::List &list,
const QDate date = QDate::fromString(value, Qt::ISODate);
QDateTime dt = QDateTime(date);
dt.setTime(QTime());
card.addLine(VCardLine(QStringLiteral("ANNIVERSARY"), createDateTime(dt, version)));
VCardLine line(QStringLiteral("ANNIVERSARY"), createDateTime(dt, version));
card.addLine(line);
}
} else if (identifier.toLower() == QLatin1String("x-kaddressbook-x-spousesname") && version == VCard::v4_0) {
if (!value.isEmpty()) {
VCardLine line( QStringLiteral("RELATED"));
line.addParameter(QStringLiteral("TYPE"), QStringLiteral("spouse"));
qDebug()<<" line valid"<<line.value();
card.addLine(line);
}
} else {
......
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