mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
refactor: Remove CNetworkWatchdog
The watchdog was used in a few places as a shortcut to skip reading data. Further, it was used in some places in the UI to display connectivity. But it also introduced quite some complexity. In some cases it can be fragile: network accessibilty cannot be looked up on all platforms/hardware constellations. The connectivity could change between the last watchdog call and the real call. Hence all readers must still handle the case where the connection fails. To simplify swift and further reduce the dependency onto the project infrastructure (pings etc.), this removes the watchdog. This also removes the QNetworkConfigurationManager, which is deprecated and not available with Qt6.
This commit is contained in:
@@ -38,7 +38,6 @@ namespace BlackCore::Data
|
||||
IndexDbHttpPort,
|
||||
IndexDbHttpsPort,
|
||||
IndexDbLoginService,
|
||||
IndexDbClientPingService,
|
||||
IndexVatsimStatus,
|
||||
IndexVatsimMetars,
|
||||
IndexVatsimData,
|
||||
@@ -53,17 +52,6 @@ namespace BlackCore::Data
|
||||
IndexAfvMapUrl
|
||||
};
|
||||
|
||||
//! Add info when pinging
|
||||
enum PingTypeFlag
|
||||
{
|
||||
PingUnspecific = 0,
|
||||
PingLogoff = 1 << 0,
|
||||
PingStarted = 1 << 1,
|
||||
PingShutdown = 1 << 2,
|
||||
PingCompleteShutdown = PingLogoff | PingShutdown
|
||||
};
|
||||
Q_DECLARE_FLAGS(PingType, PingTypeFlag)
|
||||
|
||||
//! Default constructor
|
||||
CGlobalSetup();
|
||||
|
||||
@@ -114,16 +102,6 @@ namespace BlackCore::Data
|
||||
//! \remark based on getDbRootDirectoryUrl
|
||||
BlackMisc::Network::CUrl getDbLoginServiceUrl() const;
|
||||
|
||||
//! DB ping service
|
||||
//! \remark based on getDbRootDirectoryUrl
|
||||
BlackMisc::Network::CUrl getDbClientPingServiceUrl() const;
|
||||
|
||||
//! Ping the DB server, fire and forget (no feedback etc)
|
||||
BlackMisc::Network::CUrl getDbClientPingServiceUrl(PingType type) const;
|
||||
|
||||
//! Seconds between pings
|
||||
qint64 getDbClientPingIntervalSecs() const { return m_pingIntervalSecs; }
|
||||
|
||||
//! alpha XSwiftBus files available
|
||||
BlackMisc::Network::CUrl getAlphaXSwiftBusFilesServiceUrl() const;
|
||||
|
||||
@@ -202,7 +180,6 @@ namespace BlackCore::Data
|
||||
private:
|
||||
int m_dbHttpPort = 80; //!< port
|
||||
int m_dbHttpsPort = 443; //!< SSL port
|
||||
qint64 m_pingIntervalSecs = 180; //!< seconds between datastore pings
|
||||
QString m_mappingMinimumVersion; //!< minimum version
|
||||
BlackMisc::Network::CUrl m_crashReportServerUrl; //!< crash report server
|
||||
BlackMisc::Network::CUrl m_dbRootDirectoryUrl; //!< Root directory of DB
|
||||
@@ -228,7 +205,6 @@ namespace BlackCore::Data
|
||||
BLACK_METAMEMBER(dbRootDirectoryUrl, 0, RequiredForJson),
|
||||
BLACK_METAMEMBER(dbHttpPort, 0, RequiredForJson),
|
||||
BLACK_METAMEMBER(dbHttpsPort, 0, RequiredForJson),
|
||||
BLACK_METAMEMBER(pingIntervalSecs, 0, RequiredForJson),
|
||||
BLACK_METAMEMBER(vatsimStatusFileUrls, 0, RequiredForJson),
|
||||
BLACK_METAMEMBER(vatsimDataFileUrls, 0, RequiredForJson),
|
||||
BLACK_METAMEMBER(vatsimServerFileUrl, 0, RequiredForJson),
|
||||
@@ -250,8 +226,5 @@ namespace BlackCore::Data
|
||||
} // ns
|
||||
|
||||
Q_DECLARE_METATYPE(BlackCore::Data::CGlobalSetup)
|
||||
Q_DECLARE_METATYPE(BlackCore::Data::CGlobalSetup::PingTypeFlag)
|
||||
Q_DECLARE_METATYPE(BlackCore::Data::CGlobalSetup::PingType)
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(BlackCore::Data::CGlobalSetup::PingType)
|
||||
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user