diff options
author | Simon Rettberg | 2016-10-10 17:02:22 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-10-10 17:02:22 +0200 |
commit | 420f2894746d21938083f6785d58c869ad2c3901 (patch) | |
tree | d351360859b53be91011f28fdbf3710172540f2a /src/server | |
parent | Fix build by removing ref to TRANSLATION in res files (diff) | |
download | pvs2-420f2894746d21938083f6785d58c869ad2c3901.tar.gz pvs2-420f2894746d21938083f6785d58c869ad2c3901.tar.xz pvs2-420f2894746d21938083f6785d58c869ad2c3901.zip |
[server] Remove loadPosition() as it's pointless with per-room layouts
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 46 | ||||
-rw-r--r-- | src/server/mainwindow/mainwindow.h | 1 |
2 files changed, 2 insertions, 45 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 59e47a4..6a244fb 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -358,29 +358,6 @@ ConnectionFrame* MainWindow::createFrame(QString computerId, QPoint pxCoord, QPo return cf; } - -/***************************************************************************//** - * Load position. - * @param settings - * @param id - * @param x - * @param y - * @return If loadPosition was successfull. - */ -bool MainWindow::loadPosition(QSharedPointer<QSettings> settings, const QString& id, int& x, int& y) -{ - settings->beginGroup("client_position"); - const QVariant retval = (settings->value(id)); - settings->endGroup(); - if (retval.type() != QVariant::Point) - return false; - const QPoint point(retval.toPoint()); - x = point.x(); - y = point.y(); - return true; -} - - /***************************************************************************//** * Tells the new client the current situation in class room. * Set the specific parameters like projection source or lock screen. @@ -1271,27 +1248,8 @@ void MainWindow::onClientAuthenticated(Client* client) // New one, create ConnectionFrame *cf = createFrame(); - // Try to load last known position - int x, y; - bool ok; - - QSharedPointer<QSettings> sys = serverApp->getSettings(); - ok = loadPosition(sys, client->ip(), x, y); - - if (x >= _tilesX || y >= _tilesY) - ok = false; - if (ok) { - if (x < 0) - x = 0; - if (y < 0) - y = 0; - qDebug("Move E"); - cf->move(x * getTileWidthPx(), y * getTileHeightPx()); - onPlaceFrame(true, cf); - } else { - // Move to any free tile - placeFrameInFreeSlot(cf); - } + // Move to any free tile + placeFrameInFreeSlot(cf); // Set Tutor option cf->setTutor(isTutor); // Assign client instance diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h index 637628a..69be1bf 100644 --- a/src/server/mainwindow/mainwindow.h +++ b/src/server/mainwindow/mainwindow.h @@ -79,7 +79,6 @@ private: void placeFrameInFreeSlot(ConnectionFrame* frame, QPoint preferred = QPoint(0, 0)); ConnectionFrame* createFrame(); ConnectionFrame* createFrame(QString computerId, QPoint position, QPoint gridPosition); - bool loadPosition(QSharedPointer<QSettings> settings, const QString& id, int& x, int& y); void savePosition(ConnectionFrame *cf); void startVncServerIfNecessary(int from); void tellClientCurrentSituation(Client* client); |