summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/serverinfo.h
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.h
parentf8fb4274ee56025551ddad84232c02c2a49dfcce (diff)
downloadrockbox-f608de723c.tar.gz
rockbox-f608de723c.tar.bz2
rockbox-f608de723c.zip
rbutil: Convert ServerInfo to singleton.
Change-Id: I29d94eb6bae084754e5e3f337c41de8354ba123c
Diffstat (limited to 'rbutil/rbutilqt/base/serverinfo.h')
-rw-r--r--rbutil/rbutilqt/base/serverinfo.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/rbutil/rbutilqt/base/serverinfo.h b/rbutil/rbutilqt/base/serverinfo.h
index e8d7cd5b74..9affcb6032 100644
--- a/rbutil/rbutilqt/base/serverinfo.h
+++ b/rbutil/rbutilqt/base/serverinfo.h
@@ -18,6 +18,9 @@
*
****************************************************************************/
+// Parse and provide information from build server via build-info file.
+// This is a singleton.
+
#ifndef SERVERINFO_H
#define SERVERINFO_H
@@ -47,17 +50,21 @@ class ServerInfo : public QObject
RelCandidateUrl,
};
+ static ServerInfo* instance();
+
//! read in buildinfo file
- static void readBuildInfo(QString file);
+ void readBuildInfo(QString file);
//! get a value from server info for a named platform.
- static QVariant platformValue(enum ServerInfos setting, QString platform = "");
- //! Convert status number to string
- static QString statusToString(int status);
+ QVariant platformValue(enum ServerInfos setting, QString platform = "");
+ //! Get status number as string
+ QString statusAsString(QString platform = "");
- private:
- //! you shouldnt call this, its a fully static class
- ServerInfo() {}
+ protected:
+ ServerInfo() : serverSettings(nullptr) {}
+ private:
+ static ServerInfo* infoInstance;
+ QSettings* serverSettings;
};