From 7af835c93948efa6a2160f7516b9f3296590a22f Mon Sep 17 00:00:00 2001 From: Michael Marley Date: Sat, 13 Jun 2015 17:38:29 -0400 Subject: [PATCH] Keep _wantReconnect set to true by default instead of false Previously _wantReconnect was set to false by default (unless the client was actually disconnected). If the disconnect() signal was fired without any other signals (socketError(), for example), this would cause the client to not reconnect. This seems to be happening rather often with Qt5 client builds because a vast majority of the time when I restart my core (or the entire core server), the Qt5 clients do not reconnect. This patch keeps _wantReconnect set to true whenever the client is connected so that problem will not occur anymore. Disconnecting manually will set it back to false so that the client won't try to reconnect after a manual disconnect. --- src/client/coreconnection.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client/coreconnection.cpp b/src/client/coreconnection.cpp index 0e4b4f94..9f876f91 100644 --- a/src/client/coreconnection.cpp +++ b/src/client/coreconnection.cpp @@ -216,6 +216,8 @@ void CoreConnection::setState(ConnectionState state) if (state != _state) { _state = state; emit stateChanged(state); + if (state == Connected) + _wantReconnect = true; if (state == Disconnected) emit disconnected(); } -- 2.20.1