From 1b459a8124b77fdef12e05d8a77b471be9097776 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 10 Jul 2015 15:03:43 +0200 Subject: [PATCH] QAbstractSocket: Always set errorString right after socketError Otherwise errorString() might not match error() in a statusChanged handler. Change-Id: If1250b4552412eabe88457dee031e4ef3f533838 Reviewed-by: Alex Trotsenko Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- src/network/socket/qabstractsocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 009bc90bf5..d1b13c1191 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -2086,10 +2086,10 @@ bool QAbstractSocket::waitForConnected(int msecs) if ((timedOut && state() != ConnectedState) || state() == ConnectingState) { d->socketError = SocketTimeoutError; + setErrorString(tr("Socket operation timed out")); d->state = UnconnectedState; emit stateChanged(d->state); d->resetSocketLayer(); - setErrorString(tr("Socket operation timed out")); } #if defined (QABSTRACTSOCKET_DEBUG)