Commit 09a792d2 authored by Nicolas Fella's avatar Nicolas Fella Committed by Laurent Montel
Browse files

Port away from deprecated KPluginLoader

parent 05411707
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "web/weblistwidget.h" #include "web/weblistwidget.h"
#include <KLocalizedString> #include <KLocalizedString>
#include <KPluginFactory> #include <KPluginFactory>
#include <KPluginLoader>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QLabel> #include <QLabel>
#include <QVBoxLayout> #include <QVBoxLayout>
...@@ -75,14 +74,16 @@ GeneralInfoWidget::GeneralInfoWidget(QWidget *parent) ...@@ -75,14 +74,16 @@ GeneralInfoWidget::GeneralInfoWidget(QWidget *parent)
label->setObjectName(QStringLiteral("categorylabel")); label->setObjectName(QStringLiteral("categorylabel"));
categoryWidgetLayout->addWidget(label); categoryWidgetLayout->addWidget(label);
KPluginLoader loader(QStringLiteral("akonadi/contacts/plugins/categorieseditwidgetplugin")); const KPluginMetaData editWidgetPlugin(QStringLiteral("akonadi/contacts/plugins/categorieseditwidgetplugin"));
KPluginFactory *factory = loader.factory(); const auto result = KPluginFactory::instantiatePlugin<ContactEditor::CategoriesEditAbstractWidget>(editWidgetPlugin, parent);
if (factory) {
mCategoriesWidget = factory->create<ContactEditor::CategoriesEditAbstractWidget>(parent); if (result) {
mCategoriesWidget = result.plugin;
} else { } else {
mCategoriesWidget = new CategoriesEditWidget(parent); mCategoriesWidget = new CategoriesEditWidget(parent);
label->setVisible(false); label->setVisible(false);
} }
mCategoriesWidget->setObjectName(QStringLiteral("categories")); mCategoriesWidget->setObjectName(QStringLiteral("categories"));
categoryWidgetLayout->addWidget(mCategoriesWidget); categoryWidgetLayout->addWidget(mCategoriesWidget);
leftLayout->addWidget(categoryWidget); leftLayout->addWidget(categoryWidget);
......
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