forked from qt-creator/qt-creator
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:
@@ -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
|
\internal
|
||||||
*/
|
*/
|
||||||
@@ -1645,8 +1633,11 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt
|
|||||||
profilingReport(">stop", spec);
|
profilingReport(">stop", spec);
|
||||||
if (spec->d->stop() == IPlugin::AsynchronousShutdown) {
|
if (spec->d->stop() == IPlugin::AsynchronousShutdown) {
|
||||||
asynchronousPlugins << spec;
|
asynchronousPlugins << spec;
|
||||||
connect(spec->plugin(), &IPlugin::asynchronousShutdownFinished,
|
connect(spec->plugin(), &IPlugin::asynchronousShutdownFinished, this, [this, spec] {
|
||||||
this, &PluginManagerPrivate::asyncShutdownFinished);
|
asynchronousPlugins.remove(spec);
|
||||||
|
if (asynchronousPlugins.isEmpty())
|
||||||
|
shutdownEventLoop->exit();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
profilingReport("<stop", spec);
|
profilingReport("<stop", spec);
|
||||||
break;
|
break;
|
||||||
|
@@ -160,7 +160,6 @@ private:
|
|||||||
PluginManager *q;
|
PluginManager *q;
|
||||||
|
|
||||||
void nextDelayedInitialize();
|
void nextDelayedInitialize();
|
||||||
void asyncShutdownFinished();
|
|
||||||
|
|
||||||
void readPluginPaths();
|
void readPluginPaths();
|
||||||
bool loadQueue(PluginSpec *spec,
|
bool loadQueue(PluginSpec *spec,
|
||||||
|
Reference in New Issue
Block a user