Port away from KPluginLoader::findPlugins
This commit is contained in:
parent
6c2834cc8a
commit
e431b453b6
9 changed files with 12 additions and 12 deletions
|
@ -282,7 +282,7 @@ void TestPluginEffectLoader::testLoadPluginEffect()
|
|||
KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig);
|
||||
loader.setConfig(config);
|
||||
|
||||
const auto plugins = KPluginLoader::findPlugins(QString(),
|
||||
const auto plugins = KPluginMetaData::findPlugins(QString(),
|
||||
[name] (const KPluginMetaData &data) {
|
||||
return data.pluginId().compare(name, Qt::CaseInsensitive) == 0 && data.serviceTypes().contains(QStringLiteral("KWin/Effect"));
|
||||
}
|
||||
|
|
|
@ -196,7 +196,7 @@ bool Compositor::setupStart()
|
|||
<< "Configured compositor not supported by Platform. Falling back to defaults";
|
||||
}
|
||||
|
||||
const auto availablePlugins = KPluginLoader::findPlugins(QStringLiteral("org.kde.kwin.scenes"));
|
||||
const auto availablePlugins = KPluginMetaData::findPlugins(QStringLiteral("org.kde.kwin.scenes"));
|
||||
|
||||
for (const KPluginMetaData &pluginMetaData : availablePlugins) {
|
||||
qCDebug(KWIN_CORE) << "Available scene plugin:" << pluginMetaData.fileName();
|
||||
|
|
|
@ -357,7 +357,7 @@ bool PluginEffectLoader::hasEffect(const QString &name) const
|
|||
|
||||
KPluginMetaData PluginEffectLoader::findEffect(const QString &name) const
|
||||
{
|
||||
const auto plugins = KPluginLoader::findPlugins(m_pluginSubDirectory,
|
||||
const auto plugins = KPluginMetaData::findPlugins(m_pluginSubDirectory,
|
||||
[name] (const KPluginMetaData &data) {
|
||||
return data.pluginId().compare(name, Qt::CaseInsensitive) == 0 && data.serviceTypes().contains(s_serviceType);
|
||||
}
|
||||
|
@ -493,7 +493,7 @@ void PluginEffectLoader::queryAndLoadAll()
|
|||
|
||||
QVector<KPluginMetaData> PluginEffectLoader::findAllEffects() const
|
||||
{
|
||||
return KPluginLoader::findPlugins(m_pluginSubDirectory, [] (const KPluginMetaData &data) { return data.serviceTypes().contains(s_serviceType); });
|
||||
return KPluginMetaData::findPlugins(m_pluginSubDirectory, [] (const KPluginMetaData &data) { return data.serviceTypes().contains(s_serviceType); });
|
||||
}
|
||||
|
||||
void PluginEffectLoader::setPluginSubDirectory(const QString &directory)
|
||||
|
|
|
@ -332,7 +332,7 @@ void EffectsModel::loadJavascriptEffects(const KConfigGroup &kwinConfig)
|
|||
|
||||
void EffectsModel::loadPluginEffects(const KConfigGroup &kwinConfig)
|
||||
{
|
||||
const auto pluginEffects = KPluginLoader::findPlugins(
|
||||
const auto pluginEffects = KPluginMetaData::findPlugins(
|
||||
QStringLiteral("kwin/effects/plugins/"),
|
||||
[](const KPluginMetaData &data) {
|
||||
return data.serviceTypes().contains(QStringLiteral("KWin/Effect"));
|
||||
|
@ -368,7 +368,7 @@ void EffectsModel::loadPluginEffects(const KConfigGroup &kwinConfig)
|
|||
return parentComponents.contains(pluginEffect.pluginId());
|
||||
};
|
||||
|
||||
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("kwin/effects/configs/"), filter);
|
||||
const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(QStringLiteral("kwin/effects/configs/"), filter);
|
||||
|
||||
if (!plugins.isEmpty()) {
|
||||
effect.configModule = plugins.first().pluginId();
|
||||
|
|
|
@ -108,7 +108,7 @@ void PreviewBridge::createFactory()
|
|||
return;
|
||||
}
|
||||
|
||||
const auto offers = KPluginLoader::findPlugins(s_pluginName);
|
||||
const auto offers = KPluginMetaData::findPlugins(s_pluginName);
|
||||
auto item = std::find_if(offers.constBegin(), offers.constEnd(), [this](const auto &plugin) { return plugin.pluginId() == m_plugin; });
|
||||
if (item != offers.constEnd()) {
|
||||
KPluginLoader loader(item->fileName());
|
||||
|
|
|
@ -225,7 +225,7 @@
|
|||
<entry key="CommandInactiveTitlebar2" type="Enum">
|
||||
<default>Nothing</default>
|
||||
<choices>
|
||||
<choice name="ActivateAndRaise" value="Activate and raise"></choice>
|
||||
<choice name="ActivateAndRaise" value="Activate and raisewwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww"></choice>
|
||||
<choice name="ActivateAndLower" value="Activate and lower"></choice>
|
||||
<choice name="Activate"></choice>
|
||||
<choice name="Raise"></choice>
|
||||
|
|
|
@ -391,7 +391,7 @@ void KWinTabBoxConfig::configureEffectClicked()
|
|||
return parentComponents.contains(name);
|
||||
};
|
||||
|
||||
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("kwin/effects/configs/"), filter);
|
||||
const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(QStringLiteral("kwin/effects/configs/"), filter);
|
||||
|
||||
if (plugins.isEmpty()) {
|
||||
delete configDialog;
|
||||
|
|
|
@ -408,7 +408,7 @@ int main(int argc, char * argv[])
|
|||
KWin::Application::createAboutData();
|
||||
KQuickAddons::QtQuickSettings::init();
|
||||
|
||||
const auto availablePlugins = KPluginLoader::findPlugins(QStringLiteral("org.kde.kwin.waylandbackends"));
|
||||
const auto availablePlugins = KPluginMetaData::findPlugins(QStringLiteral("org.kde.kwin.waylandbackends"));
|
||||
auto hasPlugin = [&availablePlugins] (const QString &name) {
|
||||
return std::any_of(availablePlugins.begin(), availablePlugins.end(),
|
||||
[name] (const KPluginMetaData &plugin) {
|
||||
|
|
|
@ -64,7 +64,7 @@ PluginManager::PluginManager(QObject *parent)
|
|||
}
|
||||
}
|
||||
|
||||
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(s_pluginDirectory);
|
||||
const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(s_pluginDirectory);
|
||||
for (const KPluginMetaData &metadata : plugins) {
|
||||
if (m_plugins.contains(metadata.pluginId())) {
|
||||
qCWarning(KWIN_CORE) << "Conflicting plugin id" << metadata.pluginId();
|
||||
|
@ -92,7 +92,7 @@ QStringList PluginManager::availablePlugins() const
|
|||
{
|
||||
QStringList ret = m_staticPlugins.keys();
|
||||
|
||||
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(s_pluginDirectory);
|
||||
const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(s_pluginDirectory);
|
||||
for (const KPluginMetaData &metadata : plugins) {
|
||||
ret.append(metadata.pluginId());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue