summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Petersson <martin.petersson@nokia.com>2011-05-09 13:56:47 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-11 16:39:59 +0200
commit483807d4f24f9fa39727f0a83b31435d2774386a (patch)
treecdc5d9e0bf976da2a9af8fc742b3cda3bcdac5c2
parent01cbab598a7c4f199fa5782efdf6dc5666d04ed3 (diff)
emit QNetWorkAccessManager::finished on QNetworkReply::abort()
If we can not get online when the request is made then we are in the WaitingForSession state. This will happen for example if the device is in flight mode. This fix follows the same logic as in _q_networkSessionFailed, but we should look into why we have the WaitingForSession check in finished(). Task-number: QT-4747 Reviewed-by: Markus Goetz (cherry picked from commit 0c9cb9a34d6b472cb53bf1af4616af55b593b616)
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index ac51119ce7..bf36ae8a4c 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -859,6 +859,8 @@ void QNetworkReplyImpl::abort()
if (d->state != QNetworkReplyImplPrivate::Finished) {
// call finished which will emit signals
d->error(OperationCanceledError, tr("Operation canceled"));
+ if (d->state == QNetworkReplyImplPrivate::WaitingForSession)
+ d->state = QNetworkReplyImplPrivate::Working;
d->finished();
}
d->state = QNetworkReplyImplPrivate::Aborted;