From 0a5440b2f05d2cebf5b47e2155a3ed0f65d5d0d1 Mon Sep 17 00:00:00 2001 From: Martin Petersson Date: Mon, 16 Apr 2012 12:41:42 +0200 Subject: [PATCH] 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 Reviewed-by: Shane Kearns --- src/network/access/qnetworkreplyhttpimpl.cpp | 5 +---- src/network/access/qnetworkreplyimpl.cpp | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index 101e1aa..7977704 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 c0b8acc..3ab8464 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; } -- 2.7.4