summaryrefslogtreecommitdiffstats
path: root/src/client/toolbar/toolbar.cpp
diff options
context:
space:
mode:
authorSimon Rettberg2016-10-26 15:10:30 +0200
committerSimon Rettberg2016-10-26 15:10:30 +0200
commita780afe9f9ab9ac6938ee6d9919e2a70e9735cbb (patch)
treea5130c901737b905ad73c0b60af2ece46c222801 /src/client/toolbar/toolbar.cpp
parent[client] Create config dir before trying to create vnc password file inside (diff)
downloadpvs2-a780afe9f9ab9ac6938ee6d9919e2a70e9735cbb.tar.gz
pvs2-a780afe9f9ab9ac6938ee6d9919e2a70e9735cbb.tar.xz
pvs2-a780afe9f9ab9ac6938ee6d9919e2a70e9735cbb.zip
Fix GUI translation: Don't create persistent objects on stack :/
Diffstat (limited to 'src/client/toolbar/toolbar.cpp')
-rw-r--r--src/client/toolbar/toolbar.cpp28
1 files changed, 2 insertions, 26 deletions
diff --git a/src/client/toolbar/toolbar.cpp b/src/client/toolbar/toolbar.cpp
index 56e1c23..3d370dd 100644
--- a/src/client/toolbar/toolbar.cpp
+++ b/src/client/toolbar/toolbar.cpp
@@ -4,8 +4,8 @@
* Created on: 21.01.2013
* Author: sr
*/
-#include <QNetworkInterface>
#include <QtAlgorithms>
+#include <QNetworkInterface>
#include <QProcess>
#include "../../shared/settings.h"
#include "../net/serverconnection.h"
@@ -110,8 +110,7 @@ void Toolbar::init()
initMenu();
/* setup manager button */
- _isManagerPc = isManagerPc();
- if (_isManagerPc) {
+ if (clientApp->isManagerPc()) {
connect(_ui->btnManager, SIGNAL(toggled(bool)), this, SLOT(onBtnManager()));
} else {
setFixedWidth(width() - _ui->btnManager->width());
@@ -240,29 +239,6 @@ void Toolbar::enterEvent(QEvent* e)
*/
-/* returns true when the pc of this client is also eligible to be a manager */
-bool Toolbar::isManagerPc()
-{
- QList<Room> myRooms;
- auto conf = clientApp->getSettings();
- QStringList roomNames = conf->value("rooms").toStringList();
-
- /* 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();
-
- foreach (const QHostAddress & address, QNetworkInterface::allAddresses()) {
- QString ip = conf->value("ip").toString();
- if (address.toString() == mgrIP) {
- return true;
- }
- }
- conf->endGroup();
- }
- return false;
-}
-
/* returns a sorted list of available rooms.
* (Available means that this client is configured to be in that room) */
QList<Room> Toolbar::myRooms()