diff --git a/src/effectloader.cpp b/src/effectloader.cpp index 5fbb33e6bf..84111d0a0e 100644 --- a/src/effectloader.cpp +++ b/src/effectloader.cpp @@ -194,7 +194,6 @@ void ScriptedEffectLoader::clear() PluginEffectLoader::PluginEffectLoader(QObject *parent) : AbstractEffectLoader(parent) - , m_queue(new EffectLoadQueue< PluginEffectLoader, KPluginMetaData>(this)) , m_pluginSubDirectory(QStringLiteral("kwin/effects/plugins")) { } @@ -332,25 +331,13 @@ bool PluginEffectLoader::loadEffect(const KPluginMetaData &info, LoadEffectFlags void PluginEffectLoader::queryAndLoadAll() { - if (m_queryConnection) { - return; + const auto effects = findAllEffects(); + for (const auto &effect : effects) { + const LoadEffectFlags flags = readConfig(effect.pluginId(), effect.isEnabledByDefault()); + if (flags.testFlag(LoadEffectFlag::Load)) { + loadEffect(effect, flags); + } } - // perform querying for the services in a thread - QFutureWatcher> *watcher = new QFutureWatcher>(this); - m_queryConnection = connect(watcher, &QFutureWatcher>::finished, this, - [this, watcher]() { - const auto effects = watcher->result(); - for (const auto &effect : effects) { - const LoadEffectFlags flags = readConfig(effect.pluginId(), effect.isEnabledByDefault()); - if (flags.testFlag(LoadEffectFlag::Load)) { - m_queue->enqueue(qMakePair(effect, flags)); - } - } - watcher->deleteLater(); - m_queryConnection = QMetaObject::Connection(); - }, - Qt::QueuedConnection); - watcher->setFuture(QtConcurrent::run(this, &PluginEffectLoader::findAllEffects)); } QVector PluginEffectLoader::findAllEffects() const @@ -365,9 +352,6 @@ void PluginEffectLoader::setPluginSubDirectory(const QString &directory) void PluginEffectLoader::clear() { - disconnect(m_queryConnection); - m_queryConnection = QMetaObject::Connection(); - m_queue->clear(); } EffectLoader::EffectLoader(QObject *parent) diff --git a/src/effectloader.h b/src/effectloader.h index 4b0594564b..8c2a132b19 100644 --- a/src/effectloader.h +++ b/src/effectloader.h @@ -317,9 +317,7 @@ private: KPluginMetaData findEffect(const QString &name) const; EffectPluginFactory *factory(const KPluginMetaData &info) const; QStringList m_loadedEffects; - EffectLoadQueue< PluginEffectLoader, KPluginMetaData> *m_queue; QString m_pluginSubDirectory; - QMetaObject::Connection m_queryConnection; }; class KWIN_EXPORT EffectLoader : public AbstractEffectLoader