ExtensionSystem: Remove the IPlugin back pointer to pluginspec

The price of having to loop in two places seems small compared
to cleaner relations between the classes.

There's a new hack in the helpmanager to make sure we aren't
looping to often. The hack wouldn't be needed if the (odd(?))
check there weren't there.

Change-Id: Ifed50213b2de8feedfb45c185808d163c00c19ca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2023-02-09 07:23:39 +01:00
parent 2a2f6afb04
commit 4b9aaf6ca1
13 changed files with 41 additions and 58 deletions

View File

@@ -1556,6 +1556,15 @@ void PluginManager::checkForProblematicPlugins()
d->checkForProblematicPlugins();
}
/*!
Returns the PluginSpec corresponding to \a plugin.
*/
PluginSpec *PluginManager::specForPlugin(IPlugin *plugin)
{
return findOrDefault(d->pluginSpecs, equal(&PluginSpec::plugin, plugin));
}
/*!
\internal
*/