mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Refactor listening for and connecting to XSwiftBus
- Use common function for Session and P2P connections - Don't use the DBus service watcher as it did not allow to test in regular intervals - Add a XSwiftBus version check to X-Plane listener - Try to initialize and acquire multiplayer planes in checkConnection() already and warn the user if any of those failed. The plugin will be loaded only if everything succeeded.
This commit is contained in:
committed by
Klaus Basan
parent
49bd38d722
commit
db7ed76bc5
@@ -277,18 +277,16 @@ namespace BlackSimPlugin
|
||||
virtual void checkImpl() override;
|
||||
|
||||
private:
|
||||
//! Check if XSwiftBus service is already registered on the bus
|
||||
void checkConnection();
|
||||
void checkConnectionViaBus(const QString &address);
|
||||
|
||||
//! Check if XSwiftBus service is available via P2P address
|
||||
void checkConnectionViaPeer();
|
||||
void checkConnectionViaPeer(const QString &address);
|
||||
void checkConnectionCommon();
|
||||
|
||||
void serviceRegistered(const QString &serviceName);
|
||||
void xSwiftBusServerSettingChanged();
|
||||
|
||||
QTimer m_timer { this };
|
||||
QDBusConnection m_conn { "default" };
|
||||
QDBusServiceWatcher *m_watcher { nullptr };
|
||||
BlackMisc::CSettingReadOnly<BlackMisc::Simulation::Settings::TXSwiftBusServer> m_xswiftbusServerSetting { this, &CSimulatorXPlaneListener::xSwiftBusServerSettingChanged };
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user