Commit 9bc0dff8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to build with KF < 5.86

parent 09a792d2
Pipeline #75797 passed with stage
in 11 minutes and 54 seconds
......@@ -11,6 +11,7 @@
#include "../widgets/imagewidget.h"
#include "blogfeedwidget.h"
#include "categorieseditwidget.h"
#include "kcoreaddons_version.h"
#include "mail/maillistwidget.h"
#include "messageformattingwidget.h"
#include "messaging/messaginglistwidget.h"
......@@ -20,6 +21,7 @@
#include "web/weblistwidget.h"
#include <KLocalizedString>
#include <KPluginFactory>
#include <KPluginLoader>
#include <QHBoxLayout>
#include <QLabel>
#include <QVBoxLayout>
......@@ -74,11 +76,18 @@ GeneralInfoWidget::GeneralInfoWidget(QWidget *parent)
label->setObjectName(QStringLiteral("categorylabel"));
categoryWidgetLayout->addWidget(label);
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(5, 86, 0)
KPluginLoader loader(QStringLiteral("akonadi/contacts/plugins/categorieseditwidgetplugin"));
KPluginFactory *factory = loader.factory();
if (factory) {
mCategoriesWidget = factory->create<ContactEditor::CategoriesEditAbstractWidget>(parent);
#else
const KPluginMetaData editWidgetPlugin(QStringLiteral("akonadi/contacts/plugins/categorieseditwidgetplugin"));
const auto result = KPluginFactory::instantiatePlugin<ContactEditor::CategoriesEditAbstractWidget>(editWidgetPlugin, parent);
if (result) {
mCategoriesWidget = result.plugin;
#endif
} else {
mCategoriesWidget = new CategoriesEditWidget(parent);
label->setVisible(false);
......
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