mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
CPluginManagerSimulator::getListener should not create listeners
Up to now, CPluginManagerSimulator::getListener was allocating a listener automatically in the background which was not always the desired behaviour. For example in case simulators are stopped, it is unnecessary to allocate all listeners and call stop on them. It is enough to stop the existing ones. In order to achieve the correct behaviour the creation part is moved to CPluginManagerSimulator::createListener. refs #606
This commit is contained in:
@@ -58,7 +58,7 @@ namespace BlackCore
|
||||
return getPluginById<ISimulatorFactory>(pluginId);
|
||||
}
|
||||
|
||||
ISimulatorListener *CPluginManagerSimulator::getListener(const QString &pluginId)
|
||||
ISimulatorListener *CPluginManagerSimulator::createListener(const QString &pluginId)
|
||||
{
|
||||
if (!m_plugins.contains(pluginId))
|
||||
{
|
||||
@@ -83,6 +83,17 @@ namespace BlackCore
|
||||
return plugin.listener;
|
||||
}
|
||||
|
||||
ISimulatorListener *CPluginManagerSimulator::getListener(const QString &pluginId)
|
||||
{
|
||||
if (!m_plugins.contains(pluginId))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PluginExtended &plugin = m_plugins[pluginId];
|
||||
return plugin.listener;
|
||||
}
|
||||
|
||||
CSimulatorPluginInfoList CPluginManagerSimulator::getAvailableSimulatorPlugins() const
|
||||
{
|
||||
CSimulatorPluginInfoList list;
|
||||
|
||||
Reference in New Issue
Block a user