Commit 6e51ec4b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port deprecated methods

parent 49eaf98f
Pipeline #107034 passed with stage
in 1 minute and 24 seconds
......@@ -95,7 +95,7 @@ set_package_properties(KUserFeedback PROPERTIES DESCRIPTION "User Feedback lib"
include_directories(${akregator_SOURCE_DIR} ${akregator_BINARY_DIR})
add_definitions(-DTRANSLATION_DOMAIN=\"akregator\")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055500)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055800)
if (TARGET KUserFeedbackWidgets)
add_definitions(-DWITH_KUSERFEEDBACK)
endif()
......
......@@ -16,6 +16,7 @@
#include <Syndication/Constants>
#include <kcoreaddons_version.h>
#include <KPluginMetaData>
#include <QDateTime>
#include <QFile>
#include <QIODevice>
......@@ -31,6 +32,7 @@
#include <iostream>
#include <KPluginFactory>
#include <cassert>
using namespace Akregator;
......@@ -299,13 +301,9 @@ static KService::List queryStoragePlugins()
static Plugin *createFromService(const KService::Ptr &service)
{
KPluginLoader loader(*service);
KPluginFactory *factory = loader.factory();
KPluginFactory *factory = KPluginFactory::loadFactory(KPluginMetaData(service->library())).plugin;
if (!factory) {
qCritical() << QStringLiteral(
" Could not create plugin factory for: %1\n"
" Error message: %2")
.arg(service->library(), loader.errorString());
qCritical() << QStringLiteral(" Could not create plugin factory for: %1").arg(service->library());
return nullptr;
}
return factory->create<Akregator::Plugin>();
......
......@@ -49,13 +49,9 @@ Plugin *PluginManager::createFromService(const KService::Ptr &service, QObject *
{
qCDebug(AKREGATOR_LOG) << "Trying to load:" << service->library();
KPluginLoader loader(*service);
KPluginFactory *factory = loader.factory();
KPluginFactory *factory = KPluginFactory::loadFactory(KPluginMetaData(service->library())).plugin;
if (!factory) {
qCWarning(AKREGATOR_LOG) << QStringLiteral(
" Could not create plugin factory for: %1\n"
" Error message: %2")
.arg(service->library(), loader.errorString());
qCWarning(AKREGATOR_LOG) << QStringLiteral(" Could not create plugin factory for: %1").arg(service->library());
return nullptr;
}
auto const plugin = factory->create<Plugin>(parent);
......
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