diff options
author | Steffen Ritter | 2018-06-12 13:39:49 +0200 |
---|---|---|
committer | Steffen Ritter | 2018-06-12 13:39:49 +0200 |
commit | 9e5d9dc04b5162a014e5ae342c6e1ac6321a570e (patch) | |
tree | 78933c45749d3d0172fe774da0d552f85cc99243 | |
parent | [client] Fix: read mgr state before init leads to hybrid toggle not appearing (diff) | |
download | pvs2-9e5d9dc04b5162a014e5ae342c6e1ac6321a570e.tar.gz pvs2-9e5d9dc04b5162a014e5ae342c6e1ac6321a570e.tar.xz pvs2-9e5d9dc04b5162a014e5ae342c6e1ac6321a570e.zip |
[server] Handle client disconnects
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 15 | ||||
-rw-r--r-- | src/server/mainwindow/mainwindow.h | 3 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index d4819cf..cb3ef86 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -1148,6 +1148,7 @@ void MainWindow::onClientAuthenticated(Client* client) connect(client, SIGNAL(vncServerStateChange(Client*)), this, SLOT(onVncServerStateChange(Client*))); connect(client, SIGNAL(vncClientStateChange(Client*)), this, SLOT(onVncClientStateChange(Client*))); ConnectionFrame *existing = NULL; + ConnectionFrame *cf = NULL; for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) { // qDebug() << "Existing frame ip: " << (*it)->computerId(); // qDebug() << "New Clients ip: " << client->ip(); @@ -1159,22 +1160,16 @@ void MainWindow::onClientAuthenticated(Client* client) // Clients ip already exists, but was not active. if (existing != NULL) { - // qDebug() << "Should go into this if clause."; - existing->assignClient(client); - tellClientCurrentSituation(client); - clientCountChanged(); - return; + cf = existing; + } else { + cf = createFrame(); } - // New one, create - ConnectionFrame *cf = createFrame(); - // Assign client instance cf->assignClient(client); - + connect(client, SIGNAL(disconnected()), this, SLOT(clientCountChanged())); //resizeEvent(NULL); // This is where all the positioning should be tellClientCurrentSituation(client); clientCountChanged(); - } /***************************************************************************//** diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h index 6a0db89..a07e710 100644 --- a/src/server/mainwindow/mainwindow.h +++ b/src/server/mainwindow/mainwindow.h @@ -103,11 +103,10 @@ private: void reloadCurrentRoom(); - void clientCountChanged(); - protected slots: void DisableButtons(); void EnableButtons(); + void clientCountChanged(); void onSessionNameClick(); void onSessionNameUpdate(); |