Verified Commit ed1f891a authored by Marco Rebhan's avatar Marco Rebhan
Browse files

Replace removed insertEmail with addEmail

(see KContacts commit 779da83bcfa42ddc55a17a039e2d9ae9370266d0)
parent 4b6c39ee
Pipeline #91044 passed with stage
in 4 minutes and 48 seconds
......@@ -10,6 +10,8 @@
#include <KLocalizedString>
#include <QUrl>
#include <kcontacts_version.h>
using namespace KAddressBookImportExport;
QString ContactFields::label(Field field)
......@@ -163,17 +165,24 @@ void ContactFields::setValue(Field field, const QString &value, KContacts::Addre
case ContactFields::Anniversary:
contact.insertCustom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("X-Anniversary"), value);
break;
case ContactFields::PreferredEmail:
case ContactFields::PreferredEmail: {
#if KContacts_VERSION < QT_VERSION_CHECK(5, 88, 0)
contact.insertEmail(value, true);
#else
KContacts::Email email(value);
email.setPreferred(true);
contact.addEmail(email);
#endif
break;
}
case ContactFields::Email2:
contact.insertEmail(value, false);
break;
case ContactFields::Email3:
contact.insertEmail(value, false);
break;
case ContactFields::Email4:
#if KContacts_VERSION < QT_VERSION_CHECK(5, 88, 0)
contact.insertEmail(value, false);
#else
contact.addEmail(KContacts::Email(value));
#endif
break;
case ContactFields::Role:
contact.setRole(value);
......
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