summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/serverinfo.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2020-11-19 19:54:25 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2020-11-19 21:32:41 +0100
commitf608de723c863abc0e32cd7584c046eceb910d78 (patch)
tree030cf71ffd37729b189b0731bdbb70b96943a403 /rbutil/rbutilqt/base/serverinfo.cpp
parentf8fb4274ee56025551ddad84232c02c2a49dfcce (diff)
downloadrockbox-f608de723c863abc0e32cd7584c046eceb910d78.tar.gz
rockbox-f608de723c863abc0e32cd7584c046eceb910d78.tar.bz2
rockbox-f608de723c863abc0e32cd7584c046eceb910d78.zip
rbutil: Convert ServerInfo to singleton.
Change-Id: I29d94eb6bae084754e5e3f337c41de8354ba123c
Diffstat (limited to 'rbutil/rbutilqt/base/serverinfo.cpp')
-rw-r--r--rbutil/rbutilqt/base/serverinfo.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/rbutil/rbutilqt/base/serverinfo.cpp b/rbutil/rbutilqt/base/serverinfo.cpp
index 544348c3b1..08f7f770b7 100644
--- a/rbutil/rbutilqt/base/serverinfo.cpp
+++ b/rbutil/rbutilqt/base/serverinfo.cpp
@@ -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)");