From 49357c198333fa66e4c53a13e5a56d61feaf9f79 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 22 Jan 2018 15:14:38 +0100 Subject: [client] Fix: read mgr state before init leads to hybrid toggle not appearing We determined whether the config defines the current client as manager for some room only after we read that variable to determine whether we should show the "toggle" button in the toolbar that would switch to desktop 2 (containing the manager). The result was that the button only appeared after connecting. Fixes #3290 --- src/client/clientapp/clientapp.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/client/clientapp/clientapp.cpp b/src/client/clientapp/clientapp.cpp index 911f223..251b755 100644 --- a/src/client/clientapp/clientapp.cpp +++ b/src/client/clientapp/clientapp.cpp @@ -30,9 +30,10 @@ ClientApp::ClientApp(int& argc, char** argv) translator->load(":pvsclient"); installTranslator(translator); + readIsManagerPc(); + _connectWindow = new ConnectWindow(NULL); connect(_connectWindow, SIGNAL(connected(ServerConnection*)), this, SLOT(connected(ServerConnection*))); - /* TODO: Move the connection handling to ClientApp */ if (_connectionMode == ConnectionMode::Auto) { _toolbar = new Toolbar(true); // auto connect client without session ID. } else if (_connectionMode == ConnectionMode::Session) { @@ -42,8 +43,6 @@ ClientApp::ClientApp(int& argc, char** argv) } _toolbar->setVisible(!_examMode); - readIsManagerPc(); - } /* parse arguments and return a list with the unused arguments */ @@ -96,10 +95,9 @@ void ClientApp::readIsManagerPc() /* go through all rooms and check if this client is a manager of the room. */ for (auto roomName : roomNames) { conf->beginGroup(roomName); - QString mgrIP = conf->value("mgrIP").toString(); + const QString mgrIP = conf->value("mgrIP").toString(); foreach (const QHostAddress & address, QNetworkInterface::allAddresses()) { - QString ip = conf->value("ip").toString(); if (address.toString() == mgrIP) { _isManagerPc = true; return; -- cgit v1.2.3-55-g7522