summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorMartin Petersson <Martin.Petersson@nokia.com>2012-04-16 12:41:42 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-16 18:35:58 +0200
commit0a5440b2f05d2cebf5b47e2155a3ed0f65d5d0d1 (patch)
treed45f24b3aab5a8e3390b705320cbbbfe6a45b758 /src/network
parent2b1e0940fd8a6f95483470245cb4f56cd8cbb526 (diff)
Responses to request with AlwaysNetwork set should be cached
Previously the cache was not enabled if the request had AlwaysNetwork set. This removes the check for the CacheLoadControlAttribute when checking if the cache should be enabled. Task-number: QTBUG-15805 Change-Id: I3d0722fbc1e6c77c5b947a2af0a09e2de8f4f9df Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp5
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp5
2 files changed, 2 insertions, 8 deletions
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index 101e1aa222..7977704e38 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -1945,10 +1945,7 @@ void QNetworkReplyHttpImplPrivate::createCache()
{
// check if we can save and if we're allowed to
if (!managerPrivate->networkCache
- || !request.attribute(QNetworkRequest::CacheSaveControlAttribute, true).toBool()
- || request.attribute(QNetworkRequest::CacheLoadControlAttribute,
- QNetworkRequest::PreferNetwork).toInt()
- == QNetworkRequest::AlwaysNetwork)
+ || !request.attribute(QNetworkRequest::CacheSaveControlAttribute, true).toBool())
return;
cacheEnabled = true;
}
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index c0b8acc581..3ab846439b 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -451,10 +451,7 @@ void QNetworkReplyImplPrivate::createCache()
{
// check if we can save and if we're allowed to
if (!networkCache()
- || !request.attribute(QNetworkRequest::CacheSaveControlAttribute, true).toBool()
- || request.attribute(QNetworkRequest::CacheLoadControlAttribute,
- QNetworkRequest::PreferNetwork).toInt()
- == QNetworkRequest::AlwaysNetwork)
+ || !request.attribute(QNetworkRequest::CacheSaveControlAttribute, true).toBool())
return;
cacheEnabled = true;
}