diff options
author | Björn Hagemeister | 2014-06-03 14:30:50 +0200 |
---|---|---|
committer | Björn Hagemeister | 2014-06-03 14:30:50 +0200 |
commit | bfcf1842abe1459028f54756450de99a596bb64e (patch) | |
tree | 466bf53db4611707a1fe1bb7723d8c375cea1413 | |
parent | Merge branch 'master' of git.openslx.org:pvs2 (diff) | |
download | pvs2-bfcf1842abe1459028f54756450de99a596bb64e.tar.gz pvs2-bfcf1842abe1459028f54756450de99a596bb64e.tar.xz pvs2-bfcf1842abe1459028f54756450de99a596bb64e.zip |
Put searching for client with specific id into method, getClientFromId(int id).
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 13 | ||||
-rw-r--r-- | src/server/mainwindow/mainwindow.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 32613f9..087af24 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -292,6 +292,19 @@ bool MainWindow::isManagerMachine(Client* client) return false; } +Client* MainWindow::getClientFromId(int id) +{ + for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) + { + if ((*it)->client() != NULL) + { + if ((*it)->client()->id() == id) + return (*it)->client(); + } + } + return NULL; +} + /* * Overridden methods */ diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h index a15c12f..1c15e32 100644 --- a/src/server/mainwindow/mainwindow.h +++ b/src/server/mainwindow/mainwindow.h @@ -86,6 +86,8 @@ private: void resizeEvent(QResizeEvent *e); void mouseReleaseEvent(QMouseEvent* e); + Client* getClientFromId(int id); + protected slots: void onTutorListDownloaded(QByteArray& tutorList); void onSessionNameClick(); |