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

Start to look at Bug 317966. Apply patch in this bug report

CCBUG: 317966
parent 96b96f1b
......@@ -85,9 +85,7 @@ void CustomFieldsListWidget::loadContact(const KContacts::Addressee &contact)
<< QStringLiteral("X-ManagersName")
<< QStringLiteral("X-AssistantsName")
<< QStringLiteral("X-Anniversary")
<< QStringLiteral("X-ANNIVERSARY")
<< QStringLiteral("X-SpousesName")
<< QStringLiteral("X-Profession")
<< QStringLiteral("MailPreferedFormatting")
<< QStringLiteral("MailAllowToRemoteContent")
<< QStringLiteral("CRYPTOPROTOPREF")
......@@ -96,7 +94,11 @@ void CustomFieldsListWidget::loadContact(const KContacts::Addressee &contact)
<< QStringLiteral("CRYPTOSIGNPREF")
<< QStringLiteral("CRYPTOENCRYPTPREF");
}
QSet<QString> upperCaseBlacklist;
for (const QString &blacklistEntry : qAsConst(blacklist)) {
upperCaseBlacklist << blacklistEntry.toUpper();
}
blacklist.unite(upperCaseBlacklist);
if (blacklist.contains(name)) { // several KAddressBook specific fields
continue;
}
......
......@@ -214,6 +214,14 @@ QString StandardContactFormatter::toHtml(HtmlForm form) const
titleMap.insert(QStringLiteral("IMAddress"), i18n("IM Address"));
titleMap.insert(QStringLiteral("Anniversary"), i18n("Anniversary"));
titleMap.insert(QStringLiteral("AddressBook"), i18n("Address Book"));
QMap<QString, QString> upperCaseTitleMap;
QMap<QString, QString>::const_iterator iterator = titleMap.constBegin();
while (iterator != titleMap.constEnd()) {
upperCaseTitleMap.insert(iterator.key().toUpper(), iterator.value());
++iterator;
}
titleMap.unite(upperCaseTitleMap);
}
static QSet<QString> blacklistedKeys;
......@@ -225,6 +233,8 @@ QString StandardContactFormatter::toHtml(HtmlForm form) const
blacklistedKeys.insert(QStringLiteral("CRYPTOENCRYPTPREF"));
blacklistedKeys.insert(QStringLiteral("MailPreferedFormatting"));
blacklistedKeys.insert(QStringLiteral("MailAllowToRemoteContent"));
blacklistedKeys.insert(QStringLiteral("MAILPREFEREDFORMATTING"));
blacklistedKeys.insert(QStringLiteral("MAILALLOWTOREMOTECONTENT"));
}
if (!rawContact.customs().empty()) {
......@@ -242,7 +252,7 @@ QString StandardContactFormatter::toHtml(HtmlForm form) const
if (key == QLatin1String("Anniversary") || key == QLatin1String("ANNIVERSARY")) {
const QDateTime dateTime = QDateTime::fromString(value, Qt::ISODate);
value = QLocale().toString(dateTime.date());
} else if (key == QLatin1String("BlogFeed")) { // blog is handled separated
} else if (key == QLatin1String("BlogFeed") || key == QLatin1String("BLOGFEED")) { // blog is handled separated
continue;
} else if (blacklistedKeys.contains(key)) {
continue;
......
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