Commit 7b2c369c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to KPluginFactory::instantiatePlugin

parent 6a48eb53
Pipeline #75626 canceled with stage
......@@ -6,7 +6,7 @@
*/
#include "publishdialog_p.h"
#include "kcoreaddons_version.h"
#include <Akonadi/Contact/AbstractEmailAddressSelectionDialog>
#include <Akonadi/Contact/EmailAddressSelectionDialog>
#include <KCalendarCore/Person>
......@@ -90,10 +90,19 @@ void PublishDialog::Private::insertAddresses(const KContacts::Addressee::List &l
void PublishDialog::Private::openAddressbook()
{
QPointer<Akonadi::AbstractEmailAddressSelectionDialog> dialog;
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(5, 86, 0)
KPluginLoader loader(QStringLiteral("akonadi/emailaddressselectionldapdialogplugin"));
KPluginFactory *factory = loader.factory();
if (factory) {
dialog = factory->create<Akonadi::AbstractEmailAddressSelectionDialog>(q);
#else
const KPluginMetaData editWidgetPlugin(QStringLiteral("libksieve/imapfoldercompletionplugin"));
const auto result = KPluginFactory::instantiatePlugin<Akonadi::AbstractEmailAddressSelectionDialog>(editWidgetPlugin);
if (result) {
dialog = result.plugin;
#endif
} else {
dialog = new Akonadi::EmailAddressSelectionDialog(q);
}
......
Supports Markdown
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