From 273550ed1696a25c135b74992240200db03d97e4 Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Tue, 27 May 2014 00:23:19 +0200 Subject: Drop _desiredProjectionSource. Dont send a stopVncClient if it has not been started before. --- src/server/net/client.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'src/server/net/client.cpp') diff --git a/src/server/net/client.cpp b/src/server/net/client.cpp index 7eeb3d4..4478e28 100644 --- a/src/server/net/client.cpp +++ b/src/server/net/client.cpp @@ -20,7 +20,6 @@ Client::Client(QSslSocket* socket) : _socket(socket) { assert(socket != NULL); _authed = 0; - _desiredProjectionSource = 0; _isBroadcastSource = false; _currentProjectionSource = 0; _vncPort = 0; @@ -196,16 +195,12 @@ void Client::handleMsg() if (_activeVncClient) { qDebug() << "Client " << _name << " started its VNC client (watching " << projectionSource << ")"; - if (projectionSource == _desiredProjectionSource) - _desiredProjectionSource = 0; emit vncClientStateChange(this, _currentProjectionSource); _currentProjectionSource = projectionSource; } else { qDebug() << "Client " << _name << " stopped its VNC client (watched " << projectionSource << ")"; - if (projectionSource == _desiredProjectionSource) - _desiredProjectionSource = 0; emit vncClientStateChange(this, _currentProjectionSource); _currentProjectionSource = 0; } @@ -311,20 +306,22 @@ void Client::startVncClient(const Client * const to) /******************************************************************************/ void Client::stopVncClient() { - NetworkMessage msg; - msg.setField(_ID, _VNCCLIENT); - sendMessage(msg); + if (_currentProjectionSource != 0) { + NetworkMessage msg; + msg.setField(_ID, _VNCCLIENT); + sendMessage(msg); + } } /******************************************************************************/ void Client::lockScreen(bool lock) { - if (_isTutor) - return; - NetworkMessage msg; - msg.setField(_ID, _LOCK); - msg.setField(_ENABLE, lock ? __TRUE : __FALSE); - sendMessage(msg); + if (!_isTutor){ + NetworkMessage msg; + msg.setField(_ID, _LOCK); + msg.setField(_ENABLE, lock ? __TRUE : __FALSE); + sendMessage(msg); + } } /******************************************************************************/ -- cgit v1.2.3-55-g7522