summaryrefslogtreecommitdiffstats
path: root/src/server/net/client.cpp
diff options
context:
space:
mode:
authorManuel Schneider2014-04-25 13:13:07 +0200
committerManuel Schneider2014-04-25 13:13:07 +0200
commit1c9cf62b9d6772b1aa5712cae91665cbd29642f1 (patch)
tree1d2563463b50e74dc75bf86851685d1f7448246f /src/server/net/client.cpp
parentNow using qWidget instead of qDialog to avoid the need to handdle every dialog (diff)
downloadpvs2-1c9cf62b9d6772b1aa5712cae91665cbd29642f1.tar.gz
pvs2-1c9cf62b9d6772b1aa5712cae91665cbd29642f1.tar.xz
pvs2-1c9cf62b9d6772b1aa5712cae91665cbd29642f1.zip
Now handling the _desiredProjectionSource correctly
Diffstat (limited to 'src/server/net/client.cpp')
-rw-r--r--src/server/net/client.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/net/client.cpp b/src/server/net/client.cpp
index f3cbc0d..047bd05 100644
--- a/src/server/net/client.cpp
+++ b/src/server/net/client.cpp
@@ -215,16 +215,19 @@ void Client::handleMsg()
_activeVncClient = (_fromClient.getFieldString("ENABLED").toInt() != 0);
const int other = (int)_fromClient.getFieldString("CLIENTID").toInt();
- int last = (_currentProjectionSource != 0 ? _currentProjectionSource : _desiredProjectionSource);
+ const int last = _activeVncClient ? _currentProjectionSource : other;
if (!_activeVncClient)
{
+ if (other == _desiredProjectionSource)
+ _desiredProjectionSource = 0;
_currentProjectionSource = 0;
- _desiredProjectionSource = 0;
qDebug() << "Client " << _name << " stopped its VNC client (watched " << last << ")";
}
else
{
+ if (other == _desiredProjectionSource)
+ _desiredProjectionSource = 0;
_currentProjectionSource = other;
qDebug() << "Client " << _name << " started its VNC client (watching " << other << ")";
}
@@ -334,7 +337,10 @@ void Client::disconnect()
{
if (_timerDelete == 0)
{
+ // Order of the follwing 3 is important
emit disconnected();
+ emit vncClientStateChange(this, _currentProjectionSource);
+ emit vncServerStateChange(this);
_timerDelete = startTimer(500);
qDebug("*** Client %s disconnected.", qPrintable(_ip));
_socket->blockSignals(true);