Verified Commit 6a77b17d authored by Marco Rebhan's avatar Marco Rebhan
Browse files

Replace removed insertEmail with addEmail

(see KContacts commit 779da83bcfa42ddc55a17a039e2d9ae9370266d0)
parent 1bb6ab2d
Pipeline #91060 passed with stage
in 41 minutes and 27 seconds
......@@ -18,6 +18,7 @@
#include "messagecomposer_debug.h"
#include <QPointer>
#include <kcontacts_version.h>
using namespace MessageComposer;
......@@ -75,7 +76,13 @@ void SaveContactPreferenceJob::slotSearchContact(KJob *job)
KContacts::Addressee contact;
contact.setNameFromString(fullName);
#if KContacts_VERSION < QT_VERSION_CHECK(5, 88, 0)
contact.insertEmail(mEmail, true);
#else
KContacts::Email email(mEmail);
email.setPreferred(true);
contact.addEmail(email);
#endif
writeCustomContactProperties(contact, mPref);
Akonadi::Item item(KContacts::Addressee::mimeType());
......
......@@ -13,6 +13,7 @@
#include <Akonadi/Contact/ContactSearchJob>
#include <Akonadi/ItemCreateJob>
#include <KEmailAddress>
#include <kcontacts_version.h>
#include "messagecomposer_debug.h"
#include <KLocalizedString>
......@@ -187,7 +188,11 @@ void DistributionListDialog::slotDelayedSetRecipients(KJob *job)
if (akItems.isEmpty()) {
KContacts::Addressee contact;
contact.setNameFromString(name);
#if KContacts_VERSION < QT_VERSION_CHECK(5, 88, 0)
contact.insertEmail(email);
#else
contact.addEmail(KContacts::Email(email));
#endif
auto item = new DistributionListItem(mRecipientsList);
item->setAddressee(contact, email);
......
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