diff options
author | Simon Rettberg | 2018-01-22 15:14:38 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-01-22 15:14:38 +0100 |
commit | 49357c198333fa66e4c53a13e5a56d61feaf9f79 (patch) | |
tree | fac56a149db56748a19d55a5a8bb5ad3e9e29efb /src/client | |
parent | Fix translations on Qt5 (diff) | |
download | pvs2-49357c198333fa66e4c53a13e5a56d61feaf9f79.tar.gz pvs2-49357c198333fa66e4c53a13e5a56d61feaf9f79.tar.xz pvs2-49357c198333fa66e4c53a13e5a56d61feaf9f79.zip |
[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
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/clientapp/clientapp.cpp | 8 |
1 files 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; |