Commit 06a29625 authored by Laurent Montel's avatar Laurent Montel 😁

Look at to parse vcard4 phonenumber

parent 70d10fa3
......@@ -223,5 +223,18 @@ void PhoneNumberTest::shouldParseVcard3()
void PhoneNumberTest::shouldParseVcard4()
{
QByteArray vcarddata("BEGIN:VCARD\n"
"VERSION:4.0\n"
"N:LastName;FirstName;;;\n"
"TEL;VALUE=uri;PREF=1;TYPE=\"voice,home\":tel:+44-555-555-5555;ext=5555\r\n"
"TEL;VALUE=uri;TYPE=\"voice,cell,text\":tel:+44-555-555-6666\r\n"
"TEL;VALUE=uri;TYPE=\"voice,work\":tel:+44-555-555-7777\r\n"
"UID:c80cf296-0825-4eb0-ab16-1fac1d522a33@xxxxxx.xx\n"
"LANG:fr"
"REV:2015-03-14T09:24:45+00:00\n"
"FN:FirstName LastName\n"
"END:VCARD\n");
KContacts::VCardTool vcard;
const KContacts::AddresseeList lst = vcard.parseVCards(vcarddata);
}
......@@ -1044,6 +1044,9 @@ Addressee::List VCardTool::parseVCards(const QByteArray &vcard) const
PhoneNumber::Type type;
bool foundType = false;
#if 0
qDebug() << " (*lineIt).parameters" << (*lineIt).parameterMap();
#endif
const QStringList types = (*lineIt).parameters(QStringLiteral("type"));
QStringList::ConstIterator typeEnd(types.constEnd());
for (QStringList::ConstIterator it = types.constBegin(); it != typeEnd; ++it) {
......
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