diff --git a/CMakeLists.txt b/CMakeLists.txt index 364b4010..4f8241f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE project(krfb VERSION ${RELEASE_SERVICE_VERSION}) set(QT_MIN_VERSION 5.15.0) -set(KF5_MIN_VERSION 5.85.0) +set(KF5_MIN_VERSION 5.86.0) find_package(ECM ${KF5_MIN_VERSION} NO_MODULE REQUIRED) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${ECM_MODULE_PATH}) diff --git a/krfb/eventsmanager.cpp b/krfb/eventsmanager.cpp index acd2b4c5..ba885531 100644 --- a/krfb/eventsmanager.cpp +++ b/krfb/eventsmanager.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include @@ -70,22 +69,15 @@ void EventsManager::loadPlugins() i.toBack(); QSet unique; while (i.hasPrevious()) { - KPluginMetaData data = i.previous(); + KPluginMetaData data = i.previous(); // only load plugins once, even if found multiple times! - if (unique.contains(data.name())) + if (unique.contains(data.name())) { continue; - KPluginFactory *factory = KPluginLoader(data.fileName()).factory(); - - if (!factory) { - qCDebug(KRFB) << "KPluginFactory could not load the plugin:" << data.fileName(); - continue; - } else { - qCDebug(KRFB) << "found plugin at " << data.fileName(); } - auto plugin = factory->create(this); - if (plugin) { - m_plugins.insert(data.pluginId(), plugin); + const KPluginFactory::Result result = KPluginFactory::instantiatePlugin(data); + if (result.plugin) { + m_plugins.insert(data.pluginId(), result.plugin); qCDebug(KRFB) << "Loaded plugin with name " << data.pluginId(); } else { qCDebug(KRFB) << "unable to load plugin for " << data.fileName(); diff --git a/krfb/framebuffermanager.cpp b/krfb/framebuffermanager.cpp index 4666524d..94e8cf83 100644 --- a/krfb/framebuffermanager.cpp +++ b/krfb/framebuffermanager.cpp @@ -27,7 +27,6 @@ #include #include -#include #include #include @@ -61,9 +60,7 @@ FrameBufferManager *FrameBufferManager::instance() void FrameBufferManager::loadPlugins() { - //qDebug(); - - const QVector plugins = KPluginLoader::findPlugins(QStringLiteral("krfb/framebuffer")); + const QVector plugins = KPluginMetaData::findPlugins(QStringLiteral("krfb/framebuffer")); QVectorIterator i(plugins); i.toBack(); @@ -73,18 +70,10 @@ void FrameBufferManager::loadPlugins() // only load plugins once, even if found multiple times! if (unique.contains(data.name())) continue; - KPluginFactory *factory = KPluginLoader(data.fileName()).factory(); - if (!factory) { - qCDebug(KRFB) << "KPluginFactory could not load the plugin:" << data.fileName(); - continue; - } else { - qCDebug(KRFB) << "found plugin at " << data.fileName(); - } - - auto plugin = factory->create(this); - if (plugin) { - m_plugins.insert(data.pluginId(), plugin); + const KPluginFactory::Result result = KPluginFactory::instantiatePlugin(data); + if (result.plugin) { + m_plugins.insert(data.pluginId(), result.plugin); qCDebug(KRFB) << "Loaded plugin with name " << data.pluginId(); } else { qCDebug(KRFB) << "unable to load plugin for " << data.fileName(); diff --git a/krfb/mainwindow.cpp b/krfb/mainwindow.cpp index ced23c15..496e5e05 100644 --- a/krfb/mainwindow.cpp +++ b/krfb/mainwindow.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -83,7 +82,7 @@ public: } void fillFrameBuffersCombo() { - const QVector plugins = KPluginLoader::findPlugins(QStringLiteral("krfb/framebuffer")); + const QVector plugins = KPluginMetaData::findPlugins(QStringLiteral("krfb/framebuffer")); QSet unique; QVectorIterator i(plugins); i.toBack();