[kcms/effectmodel] Use KPluginMetaData to load scripted config
Instead of going through the semi-deprecated KPluginTrader and KPluginInfo we can use KPluginLoader directly.master
parent
bf4c67678f
commit
3694580e2b
|
@ -597,18 +597,14 @@ static KCModule *findBinaryConfig(const QString &pluginId, QObject *parent)
|
||||||
|
|
||||||
static KCModule *findScriptedConfig(const QString &pluginId, QObject *parent)
|
static KCModule *findScriptedConfig(const QString &pluginId, QObject *parent)
|
||||||
{
|
{
|
||||||
const auto offers = KPluginTrader::self()->query(
|
const QVector<KPluginMetaData> offers = KPluginLoader::findPluginsById(QStringLiteral("kwin/effects/configs/"), QStringLiteral("kcm_kwin4_genericscripted"));
|
||||||
QStringLiteral("kwin/effects/configs/"),
|
|
||||||
QString(),
|
|
||||||
QStringLiteral("[X-KDE-Library] == 'kcm_kwin4_genericscripted'")
|
|
||||||
);
|
|
||||||
|
|
||||||
if (offers.isEmpty()) {
|
if (offers.isEmpty()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const KPluginInfo &generic = offers.first();
|
const KPluginMetaData &generic = offers.first();
|
||||||
KPluginLoader loader(generic.libraryPath());
|
KPluginLoader loader(generic.fileName());
|
||||||
KPluginFactory *factory = loader.factory();
|
KPluginFactory *factory = loader.factory();
|
||||||
if (!factory) {
|
if (!factory) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
Loading…
Reference in New Issue