summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorBjörn Hagemeister2014-07-30 16:59:15 +0200
committerBjörn Hagemeister2014-07-30 16:59:15 +0200
commitfb77c8310144ea7299c4cc75293dc6e87067dbd7 (patch)
treefcb2b3a81a24be5332ea2d158e85f5cd6aadab12 /src/server/mainwindow/mainwindow.cpp
parentFixed unintended bug from yesterday. (diff)
downloadpvs2-fb77c8310144ea7299c4cc75293dc6e87067dbd7.tar.gz
pvs2-fb77c8310144ea7299c4cc75293dc6e87067dbd7.tar.xz
pvs2-fb77c8310144ea7299c4cc75293dc6e87067dbd7.zip
Minimal changes: some qDebugs(), changed index of for - loop.
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index 49ffc00..48c29ac 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -324,8 +324,8 @@ void MainWindow::tryToUseRoomTemplate()
{
qDebug("Found this ip in config.");
int size = conf.beginReadArray("client");
- for (int i = 0; i < size; ++i) {
- conf.setArrayIndex(i);
+ for (int j = 0; j < size; ++j) {
+ conf.setArrayIndex(j);
/*
*
@@ -336,8 +336,9 @@ void MainWindow::tryToUseRoomTemplate()
// Add the frame
// Position is given in grid coordinates, createFrame take pixels
- qDebug() << conf.value("ip").toString();
+ QString computerId = conf.value("ip").toString();
QPoint coord = conf.value("pos").toPoint();
+ qDebug() << computerId;
qDebug() << coord;
qDebug() << _tileWidth ;
qDebug() << _tileHeight ;
@@ -346,7 +347,7 @@ void MainWindow::tryToUseRoomTemplate()
coord.setY(coord.y() * _tileHeight);
qDebug() << coord ;
- ConnectionFrame *cf = createFrame(conf.value("ip").toString(), coord);
+ ConnectionFrame *cf = createFrame(computerId, coord);
cf->move(cf->getCurrentPosition());
onPlaceFrame(false, cf);
}
@@ -990,8 +991,13 @@ void MainWindow::onClientAuthenticated(Client* client)
ConnectionFrame *existing = NULL;
for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
{
+ // qDebug() << "Existing frame ip: " << (*it)->computerId();
+ // qDebug() << "New Clients ip: " << client->ip();
+ // qDebug() << ((*it)->computerId() == client->ip());
if ((*it)->computerId() == client->ip())
+ {
existing = *it;
+ }
if ((*it)->isTutor())
{
if ((*it)->client() != NULL)
@@ -1015,7 +1021,7 @@ void MainWindow::onClientAuthenticated(Client* client)
// Clients ip already exists, but was not active.
if (existing != NULL)
{
- qDebug() << "Should go into this if clause.";
+ // qDebug() << "Should go into this if clause.";
existing->setTutor(isTutor);
existing->assignClient(client);
tellClientCurrentSituation(client);