refs #438, added plug info to listeners

* listener signal can be directly used without mapping
* (during debugging) it is much easier to identify a listener
This commit is contained in:
Klaus Basan
2015-06-02 02:48:44 +02:00
parent f423f167f3
commit 91bcba6a0c
12 changed files with 57 additions and 71 deletions

View File

@@ -327,8 +327,8 @@ namespace BlackSimPlugin
return exclude;
}
CSimulatorFs9Listener::CSimulatorFs9Listener(QObject *parent) :
BlackCore::ISimulatorListener(parent),
CSimulatorFs9Listener::CSimulatorFs9Listener(const CSimulatorPluginInfo &info, QObject *parent) :
BlackCore::ISimulatorListener(info, parent),
m_timer(new QTimer(this))
{
Q_CONSTEXPR int QueryInterval = 5 * 1000; // 5 seconds
@@ -353,7 +353,7 @@ namespace BlackSimPlugin
if (!m_isStarted && fs9Host->isConnected())
{
emit simulatorStarted();
emit simulatorStarted(getPluginInfo());
m_isStarted = true;
m_isConnecting = false;
}
@@ -402,9 +402,9 @@ namespace BlackSimPlugin
return new CSimulatorFs9(info, ownAircraftProvider, remoteAircraftProvider, pluginStorageProvider, this);
}
BlackCore::ISimulatorListener *CSimulatorFs9Factory::createListener(QObject *parent)
BlackCore::ISimulatorListener *CSimulatorFs9Factory::createListener(const CSimulatorPluginInfo &info, QObject *parent)
{
return new CSimulatorFs9Listener(parent);
return new CSimulatorFs9Listener(info, parent);
}
} // namespace

View File

@@ -128,7 +128,7 @@ namespace BlackSimPlugin
public:
//! Constructor
CSimulatorFs9Listener(QObject *parent);
CSimulatorFs9Listener(const BlackMisc::Simulation::CSimulatorPluginInfo &info, QObject *parent);
public slots:
//! \copydoc BlackCore::ISimulatorListener::start
@@ -167,7 +167,7 @@ namespace BlackSimPlugin
BlackMisc::IPluginStorageProvider *pluginStorageProvider) override;
//! \copydoc BlackCore::ISimulatorFactory::createListener
virtual BlackCore::ISimulatorListener *createListener(QObject *parent = nullptr) override;
virtual BlackCore::ISimulatorListener *createListener(const BlackMisc::Simulation::CSimulatorPluginInfo &info, QObject *parent = nullptr) override;
};
} // namespace Fs9