Commit 7e42fcc2 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Port part loading from KService to KPluginFactory

parent d80f47ab
Pipeline #99326 passed with stage
in 2 minutes and 8 seconds
......@@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
# Match KDE Frameworks update Apr 2021
set (QT_MIN_VERSION "5.15.0")
set (KF5_MIN_VERSION "5.71.0")
set (KF5_MIN_VERSION "5.86.0")
# Release script will create bugzilla versions
project(konsole VERSION ${RELEASE_SERVICE_VERSION})
......
......@@ -20,8 +20,6 @@
// KDE
#include <KMainWindow>
#include <KPluginFactory>
#include <KPluginLoader>
#include <KService>
#include <qtest.h>
// Konsole
......@@ -105,14 +103,11 @@ void PartManualTest::shortcutTriggered()
KParts::Part *PartManualTest::createPart()
{
KService::Ptr service = KService::serviceByDesktopName(QStringLiteral("konsolepart"));
Q_ASSERT(service);
KPluginFactory *factory = KPluginLoader(service->library()).factory();
Q_ASSERT(factory);
const KPluginFactory::Result<KParts::Part> result = KPluginFactory::instantiatePlugin<KParts::Part>(KPluginMetaData(QStringLiteral("konsolepart")), this);
auto *terminalPart = factory->create<KParts::Part>(this);
Q_ASSERT(result);
return terminalPart;
return result.plugin;
}
QTEST_MAIN(PartManualTest)
......@@ -12,8 +12,6 @@
#include <QMenuBar>
#include <KPluginFactory>
#include <KPluginLoader>
#include <KService>
#include <KWindowEffects>
#include <KWindowSystem>
......@@ -75,14 +73,12 @@ demo_konsolepart::~demo_konsolepart()
KParts::ReadOnlyPart *demo_konsolepart::createPart()
{
KService::Ptr service = KService::serviceByDesktopName(QStringLiteral("konsolepart"));
Q_ASSERT(service);
KPluginFactory *factory = KPluginLoader(service->library()).factory();
Q_ASSERT(factory);
const KPluginFactory::Result<KParts::ReadOnlyPart> result =
KPluginFactory::instantiatePlugin<KParts::ReadOnlyPart>(KPluginMetaData(QStringLiteral("konsolepart")), this);
auto *terminalPart = factory->create<KParts::ReadOnlyPart>(this);
Q_ASSERT(result);
return terminalPart;
return result.plugin;
}
void demo_konsolepart::manageProfiles()
......
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