summaryrefslogtreecommitdiffstats
path: root/src/server/net/client.cpp
diff options
context:
space:
mode:
authorManuel Schneider2014-05-27 00:23:19 +0200
committerManuel Schneider2014-05-27 00:23:19 +0200
commit273550ed1696a25c135b74992240200db03d97e4 (patch)
treed24bf17b97f7a8f3e2dbe3e065d445daa1e13f64 /src/server/net/client.cpp
parentReplace states by two flags indicating the state (diff)
downloadpvs2-273550ed1696a25c135b74992240200db03d97e4.tar.gz
pvs2-273550ed1696a25c135b74992240200db03d97e4.tar.xz
pvs2-273550ed1696a25c135b74992240200db03d97e4.zip
Drop _desiredProjectionSource. Dont send a stopVncClient if it has not been started before.
Diffstat (limited to 'src/server/net/client.cpp')
-rw-r--r--src/server/net/client.cpp25
1 files changed, 11 insertions, 14 deletions
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);
+ }
}
/******************************************************************************/