diff options
author | Peter Hartmann <peter.hartmann@nokia.com> | 2011-08-10 09:59:25 (GMT) |
---|---|---|
committer | Peter Hartmann <peter.hartmann@nokia.com> | 2011-08-10 09:59:25 (GMT) |
commit | c322351711d8c907184939032b226efc273988eb (patch) | |
tree | 5388a6ebbb8f7b0b9887520696c9fe0166f21ee8 /src/network | |
parent | 31f7ecbdcdbafbac5bbfa693e4d060757244941b (diff) | |
download | Qt-c322351711d8c907184939032b226efc273988eb.zip Qt-c322351711d8c907184939032b226efc273988eb.tar.gz Qt-c322351711d8c907184939032b226efc273988eb.tar.bz2 |
HTTP backend: invoke methods directly for synchronous requests
when using synchronous requests, we need to invoke some methods
directly, e.g. "metaDataChanged" would otherwise not be called when
reading data from the cache.
Patch-by: Siddharth Mathur
Reviewed-by: Peter Hartmann
Task-number: QTBUG-20796
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qnetworkaccesshttpbackend.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index 7d49648..8a247ce 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -961,9 +961,9 @@ bool QNetworkAccessHttpBackend::sendCacheContents(const QNetworkCacheMetaData &m // This needs to be emitted in the event loop because it can be reached at // the direct code path of qnam.get(...) before the user has a chance // to connect any signals. - QMetaObject::invokeMethod(this, "metaDataChanged", Qt::QueuedConnection); + QMetaObject::invokeMethod(this, "metaDataChanged", isSynchronous() ? Qt::DirectConnection : Qt::QueuedConnection); qRegisterMetaType<QIODevice*>("QIODevice*"); - QMetaObject::invokeMethod(this, "writeDownstreamData", Qt::QueuedConnection, Q_ARG(QIODevice*, contents)); + QMetaObject::invokeMethod(this, "writeDownstreamData", isSynchronous() ? Qt::DirectConnection : Qt::QueuedConnection, Q_ARG(QIODevice*, contents)); #if defined(QNETWORKACCESSHTTPBACKEND_DEBUG) |