summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-12-21 18:36:16 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-12-21 18:36:16 (GMT)
commite753230a048097e6d041ec1ff9d632c4b3b0322b (patch)
tree830b7dc38f501c262902e9125326877300282f94 /src
parent27c18a5cd8dbe2d22c8717044922ad5437e6fff4 (diff)
parent8925f402a2b8f6ac00566d917275046e77c6775c (diff)
downloadQt-e753230a048097e6d041ec1ff9d632c4b3b0322b.zip
Qt-e753230a048097e6d041ec1ff9d632c4b3b0322b.tar.gz
Qt-e753230a048097e6d041ec1ff9d632c4b3b0322b.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Fix number of chapters in qtestlib tutorial. Fixed QStatusBar not to repaint itself too early QNAM HTTP: Fix missing error() signal Make it clear which security updates are needed for Visual Studio 2005.
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/qstatusbar.cpp2
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp20
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel_p.h1
3 files changed, 21 insertions, 2 deletions
diff --git a/src/gui/widgets/qstatusbar.cpp b/src/gui/widgets/qstatusbar.cpp
index c88d2a1..c60913e 100644
--- a/src/gui/widgets/qstatusbar.cpp
+++ b/src/gui/widgets/qstatusbar.cpp
@@ -575,7 +575,7 @@ void QStatusBar::reformat()
d->savedStrut = maxH;
vbox->addSpacing(2);
d->box->activate();
- repaint();
+ update();
}
/*!
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index c8caad4..c4471eb 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -66,6 +66,7 @@ QHttpNetworkConnectionChannel::QHttpNetworkConnectionChannel()
, bytesTotal(0)
, resendCurrent(false)
, lastStatus(0)
+ , unhandledError(QNetworkReply::NoError)
, pendingEncrypt(false)
, reconnectAttempts(2)
, authMethod(QAuthenticatorPrivate::None)
@@ -642,7 +643,23 @@ void QHttpNetworkConnectionChannel::allDone()
// slot connected to it. The socket will not fire readyRead signal, if we are already
// in the slot connected to readyRead
if (emitFinished)
- QMetaObject::invokeMethod(reply, "finished", Qt::QueuedConnection);
+ {
+ // Check whether _q_error was invoked previously and if it left a socket
+ // error unhandled AND that there are no http errors.
+ // In case there are both socket errors and http errors, the socket error is suppressed.
+ // Http errors are handled in the QNetworkAccessHttpBackend.
+ if(unhandledError != QNetworkReply::NoError && reply->statusCode() == 200) {
+ QString errorString = connection->d_func()->errorDetail(unhandledError, socket, socket->errorString());
+ qRegisterMetaType<QNetworkReply::NetworkError>("QNetworkReply::NetworkError");
+ QMetaObject::invokeMethod(reply, "finishedWithError",
+ Qt::QueuedConnection,
+ Q_ARG(QNetworkReply::NetworkError, unhandledError),
+ Q_ARG(QString, errorString));
+ } else {
+ QMetaObject::invokeMethod(reply, "finished", Qt::QueuedConnection);
+ }
+ unhandledError = QNetworkReply::NoError; // Reset the value
+ }
// reset the reconnection attempts after we receive a complete reply.
// in case of failures, each channel will attempt two reconnects before emitting error.
reconnectAttempts = 2;
@@ -964,6 +981,7 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
errorCode = QNetworkReply::RemoteHostClosedError;
}
} else {
+ unhandledError = QNetworkReply::RemoteHostClosedError;
return;
}
break;
diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h
index fd18042..e1d42fb 100644
--- a/src/network/access/qhttpnetworkconnectionchannel_p.h
+++ b/src/network/access/qhttpnetworkconnectionchannel_p.h
@@ -105,6 +105,7 @@ public:
qint64 bytesTotal;
bool resendCurrent;
int lastStatus; // last status received on this channel
+ QNetworkReply::NetworkError unhandledError; // Stored code of an unhandled error.
bool pendingEncrypt; // for https (send after encrypted)
int reconnectAttempts; // maximum 2 reconnection attempts
QAuthenticatorPrivate::Method authMethod;