Verified Commit 0b234a97 authored by Marco Rebhan's avatar Marco Rebhan
Browse files

Replace removed insertEmail with addEmail

(see KContacts commit 779da83bcfa42ddc55a17a039e2d9ae9370266d0)
parent ceb93395
Pipeline #91054 passed with stage
in 29 minutes and 46 seconds
......@@ -17,6 +17,7 @@
#include <KContacts/Addressee>
#include <KEmailAddress>
#include <KLocalizedString>
#include <kcontacts_version.h>
#include <QGridLayout>
#include <QLabel>
......@@ -78,12 +79,18 @@ FilterAction::ReturnCode FilterActionAddToAddressBook::process(ItemContext &cont
for (const QString &singleEmail : emails) {
QString name;
QString email;
KContacts::Addressee::parseEmailAddress(singleEmail, name, email);
QString emailString;
KContacts::Addressee::parseEmailAddress(singleEmail, name, emailString);
KContacts::Addressee contact;
contact.setNameFromString(name);
contact.insertEmail(email, true);
#if KContacts_VERSION < QT_VERSION_CHECK(5, 88, 0)
contact.insertEmail(emailString, true);
#else
KContacts::Email email(emailString);
email.setPreferred(true);
contact.addEmail(email);
#endif
if (!mCategory.isEmpty()) {
contact.setCategories(mCategory.split(QLatin1Char(';')));
}
......
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