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

Improve import windows contact file

parent d10e382c
Pipeline #29973 canceled with stage
...@@ -232,6 +232,30 @@ KContacts::Addressee::List ImportWindowContact::importFile(const QString &fileNa ...@@ -232,6 +232,30 @@ KContacts::Addressee::List ImportWindowContact::importFile(const QString &fileNa
qCWarning(IMPORTEXPORTWINDOWSCONTACTPLUGIN_LOG) << " position tag unknown:" << positionTag; qCWarning(IMPORTEXPORTWINDOWSCONTACTPLUGIN_LOG) << " position tag unknown:" << positionTag;
} }
} }
} else if (tag == QLatin1String("c:Gender")) { //TODO verify it
KContacts::Gender gender;
gender.setGender(e.text());
contact.setGender(gender);
} else if (tag == QLatin1String("c:Notes")) { //TODO verify it
contact.setNote(e.text());
} else if (tag == QLatin1String("c:UrlCollection")) { //TODO verify it
for (QDomElement url = e.firstChildElement(); !url.isNull(); url = url.nextSiblingElement()) {
const QString urlTag = url.tagName();
if (urlTag == QLatin1String("c:Url")) {
for (QDomElement urlInfo = url.firstChildElement(); !urlInfo.isNull(); urlInfo = urlInfo.nextSiblingElement()) {
const QString urlInfoTag = urlInfo.tagName();
if (urlInfoTag == QLatin1String("c:Value")) {
KContacts::ResourceLocatorUrl url;
url.setUrl(QUrl::fromUserInput(urlInfo.text()));
contact.insertExtraUrl(url);
} else {
qCWarning(IMPORTEXPORTWINDOWSCONTACTPLUGIN_LOG) << " url info tag not supported yet " << urlInfoTag;
}
}
} else {
qCWarning(IMPORTEXPORTWINDOWSCONTACTPLUGIN_LOG) << " url tag unknown:" << urlTag;
}
}
} else { } else {
qCWarning(IMPORTEXPORTWINDOWSCONTACTPLUGIN_LOG) << "unknown tag " << tag; qCWarning(IMPORTEXPORTWINDOWSCONTACTPLUGIN_LOG) << "unknown tag " << tag;
} }
......
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