Commit eb34743d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to KPluginFactory::instantiatePlugin

parent 23951f48
Pipeline #75630 failed with stage
in 5 minutes and 40 seconds
......@@ -18,6 +18,7 @@
#include "conflictresolver.h"
#include "editorconfig.h"
#include "incidencedatetime.h"
#include "kcoreaddons_version.h"
#include "schedulingdialog.h"
#include "ui_dialogdesktop.h"
#include <CalendarSupport/FreeBusyItemModel>
......@@ -419,10 +420,19 @@ void IncidenceAttendee::insertAddresses(const KContacts::Addressee::List &list)
void IncidenceAttendee::slotSelectAddresses()
{
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>(mParentWidget);
#else
const KPluginMetaData editWidgetPlugin(QStringLiteral("akonadi/emailaddressselectionldapdialogplugin"));
const auto result = KPluginFactory::instantiatePlugin<Akonadi::AbstractEmailAddressSelectionDialog>(editWidgetPlugin, mParentWidget);
if (result) {
dialog = result.plugin;
#endif
} else {
dialog = new Akonadi::EmailAddressSelectionDialog(mParentWidget);
}
......
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