summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorBjörn Hagemeister2014-06-17 12:31:06 +0200
committerBjörn Hagemeister2014-06-17 12:31:06 +0200
commit1d771836abd9b0ef4bffbfe7f09a6f8ff2cc85db (patch)
tree71b569926f74c6dc2bcbbdab1cb35475f380f129 /src/server/mainwindow/mainwindow.cpp
parentRemoved _tutorFrame and _selectedFrame out of MainWindow to prevent possible ... (diff)
downloadpvs2-1d771836abd9b0ef4bffbfe7f09a6f8ff2cc85db.tar.gz
pvs2-1d771836abd9b0ef4bffbfe7f09a6f8ff2cc85db.tar.xz
pvs2-1d771836abd9b0ef4bffbfe7f09a6f8ff2cc85db.zip
Moved method isManagerMachine() from MainWindow to Client.
isManagerMachine() is now called just once directly in lockScreen().
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp22
1 files changed, 2 insertions, 20 deletions
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
@@ -274,21 +274,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.
* @param id
@@ -719,9 +704,7 @@ void MainWindow::onButtonLock(bool checked)
for (QList<ConnectionFrame*>::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();
}
}