From 04931d80789a860c912358fd8c706585bb82a613 Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Tue, 20 May 2014 16:05:02 +0200 Subject: Make vnc credentials completely private to client. Make VNCConnect work client-internally only. Drop Client::computerID() (equivalent to Client::ip() XD ) --- src/server/mainwindow/mainwindow.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 8ca00a0..608b8cf 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -251,7 +251,7 @@ void MainWindow::savePosition(ConnectionFrame *cf) QPoint pos(cf->pos().x() / _tileWidth, cf->pos().y() / _tileHeight); USER_SETTINGS(settings); settings.beginGroup("client_position"); - settings.setValue(client->computerId(), pos); + settings.setValue(client->ip(), pos); settings.endGroup(); } @@ -742,7 +742,7 @@ void MainWindow::onClientAuthenticated(Client* client) ConnectionFrame *existing = NULL; for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) { - if ((*it)->computerId() == client->computerId()) + if ((*it)->computerId() == client->ip()) existing = *it; if ((*it)->isTutor()) { @@ -757,7 +757,7 @@ void MainWindow::onClientAuthenticated(Client* client) for (int i = 0; i < _tutorList.size(); i++) { // Check if client is possible tutor - if (client->computerId() == _tutorList[i]) + if (client->ip() == _tutorList[i]) { isTutor = true; break; @@ -777,11 +777,11 @@ void MainWindow::onClientAuthenticated(Client* client) int x, y; bool ok; USER_SETTINGS(usr); - ok = loadPosition(usr, client->computerId(), x, y); + ok = loadPosition(usr, client->ip(), x, y); if (!ok) { SYSTEM_SETTINGS(sys); - ok = loadPosition(sys, client->computerId(), x, y); + ok = loadPosition(sys, client->ip(), x, y); } if (x >= _tilesX || y >= _tilesY) ok = false; @@ -804,7 +804,7 @@ void MainWindow::onClientAuthenticated(Client* client) cf->setTutor(isTutor); // Assign client instance cf->assignClient(client); - // ################ + // If clients are currently locked, tell this new client if (ui->action_Lock->isChecked()) client->lockScreen(true); @@ -815,7 +815,7 @@ void MainWindow::onClientAuthenticated(Client* client) Client *c = (**it).client(); if (c != NULL && c != client && c->isActiveVncServer() && c->isProjectionSource()) { - c->startVncClient(c->ip(), c->vncPort(), c->vncRoPass(), c->id(), c->name() + " @ " + c->host()); + c->startVncClient(c); client->setDesiredProjectionSource(c->id()); break; } @@ -832,7 +832,7 @@ void MainWindow::onVncServerStateChange(Client* client) { if (!isValidClient(client)) // Check here because this slot is connected queued return; - if (client->vncPort() > 0) + if (client->isActiveVncServer()) { // VNC Server started on some client - start projection on all clients interested in that client's screen for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) @@ -844,7 +844,7 @@ void MainWindow::onVncServerStateChange(Client* client) continue; // Already watching this client if (c->desiredProjectionSource() != client->id() && !client->isProjectionSource()) continue; // Not interested - c->startVncClient(client->ip(), client->vncPort(), client->vncRoPass(), client->id(), client->name() + " @ " + client->host()); + c->startVncClient(client); } } else -- cgit v1.2.3-55-g7522