From 5f310d3e0147532d734135771bafcb51a2f501ad Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Mon, 21 Jul 2014 21:19:22 +0200 Subject: Rename modes. Move code in slots to avoid unnecessary branching. Give the client more information about past progjectionSource --- src/server/net/client.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/server/net/client.cpp') diff --git a/src/server/net/client.cpp b/src/server/net/client.cpp index 584b254..dd61b45 100644 --- a/src/server/net/client.cpp +++ b/src/server/net/client.cpp @@ -21,7 +21,8 @@ Client::Client(QSslSocket* socket) : _socket(socket) { assert(socket != NULL); _authed = 0; - _currentProjectionSource = 0; + _projectionSource = 0; + _isActiveVncClient = false; _vncPort = 0; _isTutor = false; _locked = false; @@ -193,13 +194,14 @@ void Client::handleMsg() if (_fromClient.getFieldString("ENABLED").toInt() != 0) { qDebug() << "Client " << _name << " started its VNC client (watching " << projectionSource << ")"; - _currentProjectionSource = projectionSource; + _projectionSource = projectionSource; + _isActiveVncClient = true; emit vncClientStateChange(this); } else { qDebug() << "Client " << _name << " stopped its VNC client (watched " << projectionSource << ")"; - _currentProjectionSource = 0; + _isActiveVncClient = false; emit vncClientStateChange(this); } emit stateChanged(); @@ -304,7 +306,7 @@ void Client::startVncClient(const Client * const to) /******************************************************************************/ void Client::stopVncClient() { - if (_currentProjectionSource != 0) { + if (_isActiveVncClient) { NetworkMessage msg; msg.setField(_ID, _VNCCLIENT); sendMessage(msg); -- cgit v1.2.3-55-g7522