From 211bed049d7073ea95789eeedc483541f8a85b2c Mon Sep 17 00:00:00 2001 From: Christian Klinger Date: Mon, 12 Sep 2016 13:09:15 +0200 Subject: removed USER_SETTINGS etc. (this also changes filename of the crt ans rsa files, but this shouldn't be a problem. (formerly the name of those files depended on the name and location of the ini-files) --- src/server/mainwindow/mainwindow.cpp | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 8fbba96..bed07f6 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -118,7 +118,7 @@ MainWindow::MainWindow(QWidget* parent) : connect(ui->action_DeleteClient, SIGNAL(triggered()), this, SLOT(onDeleteClient())); /* In exam-mode: disable most features */ - SYSTEM_SETTINGS(conf); + SETTINGS(conf); if (conf.contains("examMode")) { Global::setExam(conf.value("examMode").toBool()); } @@ -351,21 +351,6 @@ bool MainWindow::loadPosition(QSettings& settings, const QString& id, int& x, in return true; } -/***************************************************************************//** - * Save position of given connectionFrame. - * @param cf - */ -void MainWindow::savePosition(ConnectionFrame *cf) -{ - Client *client = cf->client(); - if (client == NULL) - return; - QPoint pos(cf->pos().x() / getTileWidthPx(), cf->pos().y() / getTileHeightPx()); - USER_SETTINGS(settings); - settings.beginGroup("client_position"); - settings.setValue(client->ip(), pos); - settings.endGroup(); -} /***************************************************************************//** * Tells the new client the current situation in class room. @@ -414,7 +399,7 @@ void MainWindow::tryToUseRoomTemplate() { qDebug() << "tryToUseRoomTemplate()"; QMap roomsList; - SYSTEM_SETTINGS(conf); + SETTINGS(conf); if (!conf.contains("rooms")) { qDebug() << "Invalid config file (no rooms are set)!"; return; } QStringList rooms = conf.value("rooms").toStringList(); @@ -731,8 +716,6 @@ void MainWindow::onPlaceFrame(bool activateTrash, ConnectionFrame* connectionFra const QPoint &preferredPixels = connectionFrame->frameGeometry().center(); placeFrameInFreeSlot(connectionFrame, preferredPixels); - /* save in local config to remember position */ - savePosition(connectionFrame); resizeEvent(NULL); } @@ -1296,13 +1279,10 @@ void MainWindow::onClientAuthenticated(Client* client) // Try to load last known position int x, y; bool ok; - USER_SETTINGS(usr); - ok = loadPosition(usr, client->ip(), x, y); - if (!ok) - { - SYSTEM_SETTINGS(sys); - ok = loadPosition(sys, client->ip(), x, y); - } + + SETTINGS(sys); + ok = loadPosition(sys, client->ip(), x, y); + if (x >= _tilesX || y >= _tilesY) ok = false; if (ok) -- cgit v1.2.3-55-g7522