diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-09-01 16:36:14 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-09-01 16:36:14 (GMT) |
commit | e4804c5d3d2e80cc7f57936591374d29478dbb2a (patch) | |
tree | 76a85948ed5db925fda81028169e8dcde23b52b4 /src/network/access/qnetworkaccessbackend.cpp | |
parent | fc4c4071d6e5704e84a5cca4ae22548bedb7b19d (diff) | |
parent | b2e91ecd641b9c891ea823cfc647f729af6228e8 (diff) | |
download | Qt-e4804c5d3d2e80cc7f57936591374d29478dbb2a.zip Qt-e4804c5d3d2e80cc7f57936591374d29478dbb2a.tar.gz Qt-e4804c5d3d2e80cc7f57936591374d29478dbb2a.tar.bz2 |
Merge branch '4.5' into 4.6
Conflicts:
src/network/access/qnetworkaccessbackend.cpp
src/network/access/qnetworkreplyimpl.cpp
tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
Diffstat (limited to 'src/network/access/qnetworkaccessbackend.cpp')
-rw-r--r-- | src/network/access/qnetworkaccessbackend.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp index b624c24..be7896b 100644 --- a/src/network/access/qnetworkaccessbackend.cpp +++ b/src/network/access/qnetworkaccessbackend.cpp @@ -92,8 +92,11 @@ QNetworkAccessBackend *QNetworkAccessManagerPrivate::findBackend(QNetworkAccessM QNetworkRequest::PreferNetwork).toInt()); if (mode == QNetworkRequest::AlwaysCache && (op == QNetworkAccessManager::GetOperation - || op == QNetworkAccessManager::HeadOperation)) - return new QNetworkAccessCacheBackend; + || op == QNetworkAccessManager::HeadOperation)) { + QNetworkAccessBackend *backend = new QNetworkAccessCacheBackend; + backend->manager = this; + return backend; + } if (!factoryDataShutdown) { QMutexLocker locker(&factoryData()->mutex); @@ -111,7 +114,6 @@ QNetworkAccessBackend *QNetworkAccessManagerPrivate::findBackend(QNetworkAccessM return 0; } - QNonContiguousByteDevice* QNetworkAccessBackend::createUploadByteDevice() { QNonContiguousByteDevice* device = 0; @@ -143,6 +145,8 @@ void QNetworkAccessBackend::emitReplyUploadProgress(qint64 bytesSent, qint64 byt } QNetworkAccessBackend::QNetworkAccessBackend() + : manager(0) + , reply(0) { } @@ -205,7 +209,9 @@ QList<QNetworkProxy> QNetworkAccessBackend::proxyList() const QAbstractNetworkCache *QNetworkAccessBackend::networkCache() const { - return reply->networkCache; // should be the same as manager->networkCache + if (!manager) + return 0; + return manager->networkCache; } void QNetworkAccessBackend::setCachingEnabled(bool enable) |