From 97514a95043489f5a7f7dd009555f6abd7e31a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Mon, 20 Dec 2021 15:43:15 +0100 Subject: [PATCH] Fix multiple remoe connected changed signals even if not changed --- .../tunnelproxy/tunnelproxyremoteconnection.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.cpp b/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.cpp index a07e24c..0a21ff3 100644 --- a/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.cpp +++ b/libnymea-remoteproxyclient/tunnelproxy/tunnelproxyremoteconnection.cpp @@ -270,10 +270,16 @@ void TunnelProxyRemoteConnection::setState(State state) if (m_state == state) return; + bool remoteConnected = m_state == StateRemoteConnected; + m_state = state; qCDebug(dcTunnelProxyRemoteConnection()) << "State changed" << m_state; emit stateChanged(m_state); - emit remoteConnectedChanged(m_state == StateRemoteConnected); + + bool stillRemoteConnected = m_state == StateRemoteConnected; + if (remoteConnected != stillRemoteConnected) { + emit remoteConnectedChanged(m_state == StateRemoteConnected); + } }