From: Michael Marley Date: Thu, 23 Apr 2015 22:05:31 +0000 (-0400) Subject: Call socketDisconnected() from socketStateChanged() X-Git-Tag: travis-deploy-test~558^2 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=b9347595868ce9ec071ecf5057a04eb87d3e8e48;ds=sidebyside Call socketDisconnected() from socketStateChanged() This makes sure that socketDisconnected() is always called when Quassel disconnects even if it isn't fully connected yet. Otherwise, reconnect occasionally fails to work properly. --- diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index 932af6fc..942e32f6 100644 --- a/src/core/corenetwork.cpp +++ b/src/core/corenetwork.cpp @@ -71,7 +71,6 @@ CoreNetwork::CoreNetwork(const NetworkId &networkid, CoreSession *session) connect(&_tokenBucketTimer, SIGNAL(timeout()), this, SLOT(fillBucketAndProcessQueue())); connect(&socket, SIGNAL(connected()), this, SLOT(socketInitialized())); - connect(&socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected())); connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketError(QAbstractSocket::SocketError))); connect(&socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(socketStateChanged(QAbstractSocket::SocketState))); connect(&socket, SIGNAL(readyRead()), this, SLOT(socketHasData())); @@ -538,6 +537,7 @@ void CoreNetwork::socketStateChanged(QAbstractSocket::SocketState socketState) switch (socketState) { case QAbstractSocket::UnconnectedState: state = Network::Disconnected; + socketDisconnected(); break; case QAbstractSocket::HostLookupState: case QAbstractSocket::ConnectingState: