From 0422fd992c1e69c05b89d87486b05c823e2c7008 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 14 Oct 2024 17:15:16 +0200 Subject: [PATCH] Avoid deprecated version of setEmail vs addEmail --- src/myidentity.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/myidentity.cpp b/src/myidentity.cpp index 9b34c74d..ea83b265 100644 --- a/src/myidentity.cpp +++ b/src/myidentity.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -55,12 +56,15 @@ KContacts::Addressee MyIdentity::UIToAddressee(Ui::manualOwnIdentity ui) resUrl.setUrl(QUrl(ui.leWebsite->text())); add.setUrl(resUrl); +#if KContacts_VERSION >= QT_VERSION_CHECK(5, 88, 0) KContacts::Email email; email.setEmail(ui.leEmail->text()); email.setPreferred(true); email.setType(KContacts::Email::TypeFlag::Work); add.addEmail(email); - +#else + add.insertEmail(ui.leEmail->text(), true /* prefered */ ); +#endif return add; }