aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-07-11 07:48:15 +0200
committerMontel Laurent <[email protected]>2016-07-11 07:48:15 +0200
commitcb5263fc557260055936404608f23d19e259df95 (patch)
tree0aa096065c1dfd840f836f5dd34a68090b675691
parent6069cde7f31b24c3332f97186104a98b47369ae4 (diff)
Fix parsing label from vcard4
-rw-r--r--src/vcardtool.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vcardtool.cpp b/src/vcardtool.cpp
index c7e80a1..3cd4d50 100644
--- a/src/vcardtool.cpp
+++ b/src/vcardtool.cpp
@@ -713,7 +713,14 @@ Addressee::List VCardTool::parseVCards(const QByteArray &vcard) const
address.setType(type);
if (!(*lineIt).parameter(QStringLiteral("label")).isEmpty()) {
- address.setLabel((*lineIt).parameter(QStringLiteral("label")));
+ QString label = (*lineIt).parameter(QStringLiteral("label"));
+ if (label.length() > 1) {
+ if (label.at(0) == QLatin1Char('"') && label.at(label.length() - 1) == QLatin1Char('"')) {
+ label = label.mid(1, label.length() - 2 );
+ }
+ }
+
+ address.setLabel(label);
}
addr.insertAddress(address);
}
@@ -898,6 +905,7 @@ Addressee::List VCardTool::parseVCards(const QByteArray &vcard) const
if (!available) { // a standalone LABEL tag
KContacts::Address address(type);
address.setLabel((*lineIt).value().toString());
+ qDebug()<< "222 (*lineIt).value().toString()"<<(*lineIt).value().toString();
addr.insertAddress(address);
}
}