mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
Ref T295, fix for the "no network config" issue
* details: https://stackoverflow.com/questions/51686943/no-qnetworkconfiguration-although-i-can-connect-to-wifi * network accessibility check can be disabled if network config looks suspicious * using QNetworkConfigurationManager
This commit is contained in:
@@ -42,6 +42,13 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
void setNetworkAccessibility(QNetworkAccessManager::NetworkAccessibility accessibility);
|
||||
|
||||
//! Configuration updates completed as reported by QNetworkConfigurationManager::updateCompleted
|
||||
void networkConfigurationsUpdateCompleted();
|
||||
|
||||
//! Set online as reported by QNetworkConfigurationManager::onlineStateChanged
|
||||
//! \threadsafe
|
||||
void setOnline(bool online);
|
||||
|
||||
//! DB available?
|
||||
//! \threadsafe
|
||||
bool isSwiftDbAccessible() const { return m_dbAccessible; }
|
||||
@@ -75,6 +82,9 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
bool isInternetAccessible() const { return m_internetAccessible; }
|
||||
|
||||
//! Accesible or check disabled?
|
||||
bool isNetworkkAccessibleOrCheckDisabled() const { return m_networkAccessible || m_disableNetworkCheck; }
|
||||
|
||||
//! Has working shared URL?
|
||||
//! \threadsafe
|
||||
bool hasWorkingSharedUrl() const;
|
||||
@@ -111,6 +121,15 @@ namespace BlackCore
|
||||
//! Ping the DB server, fire and forget (no feedback etc)
|
||||
void pingDbClientService(Data::CGlobalSetup::PingType type = Data::CGlobalSetup::PingUnspecific, bool force = false);
|
||||
|
||||
//! Disable the network check
|
||||
//! \remark if disabled network reports always accessible
|
||||
//! \threadsafe
|
||||
bool disableNetworkAccessibilityCheck(bool disable);
|
||||
|
||||
//! Has network check been disabled?
|
||||
//! \threadsafe
|
||||
bool isNetworkAccessibilityCheckDisabled() const { return m_disableNetworkCheck; }
|
||||
|
||||
//! URL referring to the DB
|
||||
//! \remark depends on BlackCore::Application::getGlobalSetup()
|
||||
static bool isDbUrl(const BlackMisc::Network::CUrl &url);
|
||||
@@ -160,6 +179,8 @@ namespace BlackCore
|
||||
std::atomic_bool m_logOwnMessages { true };
|
||||
std::atomic_bool m_doDetailedCheck { true };
|
||||
std::atomic_bool m_networkAccessible { true };
|
||||
std::atomic_bool m_disableNetworkCheck { false }; //!< if this is true, network accessible always reports true/accessible
|
||||
std::atomic_bool m_online { true };
|
||||
std::atomic_bool m_internetAccessible { true };
|
||||
std::atomic_bool m_dbAccessible { true };
|
||||
std::atomic_bool m_lastClientPingSuccess { true };
|
||||
@@ -171,7 +192,7 @@ namespace BlackCore
|
||||
std::atomic_int m_totalBadCountDb { 0 }; //!< Total number of DB failing counts (only real responses when tried)
|
||||
std::atomic_int m_totalBadCountInternet { 0 }; //!< Total number of Internet failing count (only when network is accessible)
|
||||
std::atomic_int m_totalGoodCountDb { 0 };
|
||||
std::atomic_int m_totalGoodCountInternet { 0 };
|
||||
std::atomic_int m_totalGoodCountInternet { 0 };
|
||||
std::atomic_int m_consecutivePingBadCount { 0 }; //!< Bad count of ping until a godd state is received
|
||||
QString m_lastPingUrl;
|
||||
BlackMisc::Network::CUrl m_workingSharedUrl;
|
||||
|
||||
Reference in New Issue
Block a user