From fb77c8310144ea7299c4cc75293dc6e87067dbd7 Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Wed, 30 Jul 2014 16:59:15 +0200 Subject: Minimal changes: some qDebugs(), changed index of for - loop. --- src/server/mainwindow/mainwindow.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') 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::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); -- cgit v1.2.3-55-g7522