From e996d68f6130847637ba287518cff1289cfa48e5 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Fri, 6 Nov 2015 14:22:44 +1000 Subject: [PATCH] Make UnknownAccessibility not block requests This allows requests to proceed without needing bearer plugins. Task-number: QTBUG-49267 Change-Id: Ie5ce188ddefebd14d666bb5846e8f93ee2925ed1 Reviewed-by: Markus Goetz (Woboq GmbH) --- src/network/access/qnetworkaccessmanager.cpp | 3 +-- src/network/access/qnetworkaccessmanager_p.h | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 086140f..0e5870a 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -976,7 +976,6 @@ QNetworkAccessManager::NetworkAccessibility QNetworkAccessManager::networkAccess else return NotAccessible; } else { - // Network accessibility is either disabled or unknown. if (d->defaultAccessControl) { if (d->online) return d->networkAccessible; @@ -1161,7 +1160,7 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera #ifndef QT_NO_BEARERMANAGEMENT // Return a disabled network reply if network access is disabled. // Except if the scheme is empty or file://. - if (!d->networkAccessible && !isLocalFile) { + if (d->networkAccessible == NotAccessible && !isLocalFile) { return new QDisabledNetworkReply(this, req, op); } diff --git a/src/network/access/qnetworkaccessmanager_p.h b/src/network/access/qnetworkaccessmanager_p.h index 54ae114..3fc33b5 100644 --- a/src/network/access/qnetworkaccessmanager_p.h +++ b/src/network/access/qnetworkaccessmanager_p.h @@ -93,6 +93,8 @@ public: online = (networkConfiguration.state().testFlag(QNetworkConfiguration::Active)); if (online) networkAccessible = QNetworkAccessManager::Accessible; + else if (networkConfiguration.state().testFlag(QNetworkConfiguration::Undefined)) + networkAccessible = QNetworkAccessManager::UnknownAccessibility; else networkAccessible = QNetworkAccessManager::NotAccessible; #endif -- 1.9.1