PluginManager: Avoid using sender()

Change-Id: I30df454a9bab9896ec39a03d7d261fc47fbd7b7e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2022-07-19 18:04:01 +02:00
parent 54465acb15
commit 1fade11be2
2 changed files with 5 additions and 15 deletions

View File

@@ -1411,18 +1411,6 @@ void PluginManagerPrivate::shutdown()
}
}
/*!
\internal
*/
void PluginManagerPrivate::asyncShutdownFinished()
{
auto *plugin = qobject_cast<IPlugin *>(sender());
Q_ASSERT(plugin);
asynchronousPlugins.remove(plugin->pluginSpec());
if (asynchronousPlugins.isEmpty())
shutdownEventLoop->exit();
}
/*!
\internal
*/
@@ -1645,8 +1633,11 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt
profilingReport(">stop", spec);
if (spec->d->stop() == IPlugin::AsynchronousShutdown) {
asynchronousPlugins << spec;
connect(spec->plugin(), &IPlugin::asynchronousShutdownFinished,
this, &PluginManagerPrivate::asyncShutdownFinished);
connect(spec->plugin(), &IPlugin::asynchronousShutdownFinished, this, [this, spec] {
asynchronousPlugins.remove(spec);
if (asynchronousPlugins.isEmpty())
shutdownEventLoop->exit();
});
}
profilingReport("<stop", spec);
break;

View File

@@ -160,7 +160,6 @@ private:
PluginManager *q;
void nextDelayedInitialize();
void asyncShutdownFinished();
void readPluginPaths();
bool loadQueue(PluginSpec *spec,