mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
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:
@@ -430,7 +430,7 @@ namespace BlackSimPlugin
|
||||
return true;
|
||||
}
|
||||
|
||||
BlackCore::ISimulator *CSimulatorXPlaneFactory::create(const BlackMisc::Simulation::CSimulatorPluginInfo &info,
|
||||
BlackCore::ISimulator *CSimulatorXPlaneFactory::create(const CSimulatorPluginInfo &info,
|
||||
IOwnAircraftProvider *ownAircraftProvider,
|
||||
IRemoteAircraftProvider *renderedAircraftProvider,
|
||||
IPluginStorageProvider *pluginStorageProvider)
|
||||
@@ -438,19 +438,15 @@ namespace BlackSimPlugin
|
||||
return new CSimulatorXPlane(info, ownAircraftProvider, renderedAircraftProvider, pluginStorageProvider, this);
|
||||
}
|
||||
|
||||
CSimulatorXPlaneListener::CSimulatorXPlaneListener(QObject *parent): ISimulatorListener(parent)
|
||||
{
|
||||
|
||||
}
|
||||
CSimulatorXPlaneListener::CSimulatorXPlaneListener(const CSimulatorPluginInfo &info, QObject *parent): ISimulatorListener(info, parent)
|
||||
{ }
|
||||
|
||||
void CSimulatorXPlaneListener::start()
|
||||
{
|
||||
if (m_watcher) // already started
|
||||
return;
|
||||
|
||||
if (m_watcher) { return; } // already started
|
||||
if (isXBusRunning())
|
||||
{
|
||||
emit simulatorStarted();
|
||||
emit simulatorStarted(getPluginInfo());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -486,7 +482,9 @@ namespace BlackSimPlugin
|
||||
void CSimulatorXPlaneListener::ps_serviceRegistered(const QString &serviceName)
|
||||
{
|
||||
if (serviceName == xbusServiceName())
|
||||
emit simulatorStarted();
|
||||
{
|
||||
emit simulatorStarted(getPluginInfo());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace BlackSimPlugin
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
CSimulatorXPlaneListener(QObject *parent);
|
||||
CSimulatorXPlaneListener(const BlackMisc::Simulation::CSimulatorPluginInfo &info, QObject *parent);
|
||||
|
||||
public slots:
|
||||
//! \copydoc BlackCore::ISimulatorListener::start
|
||||
@@ -205,7 +205,6 @@ namespace BlackSimPlugin
|
||||
private:
|
||||
QDBusConnection m_conn { "default" };
|
||||
QDBusServiceWatcher *m_watcher { nullptr };
|
||||
|
||||
};
|
||||
|
||||
//! Factory for creating CSimulatorXPlane instance
|
||||
@@ -223,7 +222,7 @@ namespace BlackSimPlugin
|
||||
BlackMisc::IPluginStorageProvider *pluginStorageProvider) override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulatorFactory::createListener
|
||||
virtual BlackCore::ISimulatorListener *createListener(QObject *parent = nullptr) override { return new CSimulatorXPlaneListener(parent); }
|
||||
virtual BlackCore::ISimulatorListener *createListener(const BlackMisc::Simulation::CSimulatorPluginInfo &info, QObject *parent = nullptr) override { return new CSimulatorXPlaneListener(info, parent); }
|
||||
};
|
||||
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user