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:
Roland Rossgotterer
2018-11-26 14:37:11 +01:00
committed by Klaus Basan
parent 49bd38d722
commit db7ed76bc5
2 changed files with 83 additions and 84 deletions

View File

@@ -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 };
};