From 1d771836abd9b0ef4bffbfe7f09a6f8ff2cc85db Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Tue, 17 Jun 2014 12:31:06 +0200 Subject: Moved method isManagerMachine() from MainWindow to Client. isManagerMachine() is now called just once directly in lockScreen(). --- src/server/mainwindow/mainwindow.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 4af9fe1..5063df6 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -273,21 +273,6 @@ void MainWindow::tellClientCurrentSituation(Client* client) } -/***************************************************************************//** - * Checks if client and manager runs on same machine. - * @param client - * @return Return true, if pvsmanager is running on client. - */ -bool MainWindow::isManagerMachine(Client* client) -{ - foreach (const QHostAddress &address, QNetworkInterface::allAddresses()) - if (address != QHostAddress(QHostAddress::LocalHost) - && client != NULL - && client->ip() == address.toString()) - return true; - return false; -} - /***************************************************************************//** * Returns connected client which belongs to given id. * Iterating over ConnectionFrames and comparing id to given id. @@ -719,9 +704,7 @@ void MainWindow::onButtonLock(bool checked) for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) { - // Check if client is Tutor or the manager is also running on this machine. - bool isManager = isManagerMachine((*it)->client()); - if ((*it)->client() == NULL || isManager) + if ((*it)->client() == NULL) continue; (*it)->client()->lockScreen(checked); } @@ -972,8 +955,7 @@ void MainWindow::onVncServerStateChange(Client* client) else { // Lock others and stop their clients - bool isManager = isManagerMachine((*it)->client()); - (*it)->client()->lockScreen(_mode == Mode::LockedMulticast && isManager != true); + (*it)->client()->lockScreen(_mode == Mode::LockedMulticast); (*it)->client()->stopVncClient(); } } -- cgit v1.2.3-55-g7522