rbutil: Convert ServerInfo to singleton.

Change-Id: I29d94eb6bae084754e5e3f337c41de8354ba123c
This commit is contained in:
Dominik Riebeling 2020-11-19 19:54:25 +01:00
parent f8fb4274ee
commit f608de723c
7 changed files with 45 additions and 31 deletions

View file

@ -21,7 +21,15 @@
#include "systeminfo.h"
#include "Logger.h"
static QSettings* serverSettings = nullptr;
ServerInfo* ServerInfo::infoInstance = nullptr;
ServerInfo* ServerInfo::instance()
{
if (infoInstance == nullptr) {
infoInstance = new ServerInfo();
}
return infoInstance;
}
// server infos
const static struct {
@ -131,10 +139,10 @@ QVariant ServerInfo::platformValue(enum ServerInfos info, QString platform)
return value;
}
QString ServerInfo::statusToString(int status)
QString ServerInfo::statusAsString(QString platform)
{
QString value;
switch(status)
switch(platformValue(CurStatus, platform).toInt())
{
case STATUS_RETIRED:
value = tr("Stable (Retired)");