diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 8bd630ad9d..d201b9e211 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -1039,13 +1039,10 @@ QNetworkReply *QNetworkAccessManager::deleteResource(const QNetworkRequest &requ void QNetworkAccessManager::setConfiguration(const QNetworkConfiguration &config) { Q_D(QNetworkAccessManager); - if (!d->statusMonitor.isEnabled()) { - d->networkConfiguration = config; - d->customNetworkConfiguration = true; - d->createSession(config); - } else { - qWarning(lcNetMon, "No network configuration can be set with network status monitor enabled"); - } + + d->networkConfiguration = config; + d->customNetworkConfiguration = true; + d->createSession(config); } /*! @@ -1107,11 +1104,6 @@ void QNetworkAccessManager::setNetworkAccessible(QNetworkAccessManager::NetworkA { Q_D(QNetworkAccessManager); - if (d->statusMonitor.isEnabled()) { - qWarning(lcNetMon, "Can not manually set network accessibility with the network status monitor enabled"); - return; - } - d->defaultAccessControl = accessible == NotAccessible ? false : true; if (d->networkAccessible != accessible) { diff --git a/src/network/kernel/qnetconmonitor_darwin.mm b/src/network/kernel/qnetconmonitor_darwin.mm index 322c87cb4b..a64cd6e530 100644 --- a/src/network/kernel/qnetconmonitor_darwin.mm +++ b/src/network/kernel/qnetconmonitor_darwin.mm @@ -48,7 +48,6 @@ #include #include -#include QT_BEGIN_NAMESPACE @@ -309,20 +308,8 @@ public: bool isOnlineIpv4 = false; QNetworkConnectionMonitor ipv6Probe; bool isOnlineIpv6 = false; - - static bool enabled; - static void readEnv(); }; -bool QNetworkStatusMonitorPrivate::enabled = false; - -void QNetworkStatusMonitorPrivate::readEnv() -{ - bool envOk = false; - const int env = qEnvironmentVariableIntValue("QT_USE_NETWORK_MONITOR", &envOk); - enabled = envOk && env > 0; -} - QNetworkStatusMonitor::QNetworkStatusMonitor() : QObject(*new QNetworkStatusMonitorPrivate) { @@ -400,9 +387,7 @@ bool QNetworkStatusMonitor::isNetworkAccesible() bool QNetworkStatusMonitor::isEnabled() { - static std::once_flag envRead = {}; - std::call_once(envRead, QNetworkStatusMonitorPrivate::readEnv); - return QNetworkStatusMonitorPrivate::enabled; + return true; } void QNetworkStatusMonitor::reachabilityChanged(bool online)