summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/systeminfo.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2020-11-14 16:23:56 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2020-11-14 16:42:29 +0100
commit2509def164ee7f4aecbe6a786df57140f19e35f2 (patch)
tree63a7396e1b94482f9f05c3f3abf6c7cd77e10d26 /rbutil/rbutilqt/base/systeminfo.cpp
parent440083af872da43c116c5374d8e1511cef65abf2 (diff)
downloadrockbox-2509def164.tar.gz
rockbox-2509def164.tar.bz2
rockbox-2509def164.zip
rbutil: Rework player configuration.
- Split internal configuration into player specific and common parts. Always require passing the player for player specific data instead of implicitly assuming the currently selected one; only use the currently selected one if the player name is explicitly passed as empty. - Similarly adjust handling of server info data; prepare for splitting into build type specific values so the naming becomes cleaner. Change-Id: I894e694f83bd9fe2d22ad46b3f8f7df3e2c68033
Diffstat (limited to 'rbutil/rbutilqt/base/systeminfo.cpp')
-rw-r--r--rbutil/rbutilqt/base/systeminfo.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/rbutil/rbutilqt/base/systeminfo.cpp b/rbutil/rbutilqt/base/systeminfo.cpp
index d57c12a62b..c9e29a8325 100644
--- a/rbutil/rbutilqt/base/systeminfo.cpp
+++ b/rbutil/rbutilqt/base/systeminfo.cpp
@@ -49,6 +49,13 @@ const static struct {
{ SystemInfo::ThemesUrl, "themes_url", "" },
{ SystemInfo::ThemesInfoUrl, "themes_info_url", "" },
{ SystemInfo::RbutilUrl, "rbutil_url", "" },
+};
+
+const static struct {
+ SystemInfo::PlatformInfo info;
+ const char* name;
+ const char* def;
+} PlatformInfosList[] = {
{ SystemInfo::CurPlatformName, ":platform:/name", "" },
{ SystemInfo::CurManual, ":platform:/manualname","rockbox-:platform:" },
{ SystemInfo::CurBootloaderMethod, ":platform:/bootloadermethod", "none" },
@@ -85,27 +92,27 @@ QVariant SystemInfo::value(enum SystemInfos info)
int i = 0;
while(SystemInfosList[i].info != info)
i++;
- QString platform = RbSettings::value(RbSettings::CurrentPlatform).toString();
QString s = SystemInfosList[i].name;
- s.replace(":platform:", platform);
QString d = SystemInfosList[i].def;
- d.replace(":platform:", platform);
LOG_INFO() << "GET:" << s << systemInfos->value(s, d).toString();
return systemInfos->value(s, d);
}
-QVariant SystemInfo::platformValue(QString platform, enum SystemInfos info)
+QVariant SystemInfo::platformValue(enum PlatformInfo info, QString platform)
{
ensureSystemInfoExists();
// locate setting item
int i = 0;
- while(SystemInfosList[i].info != info)
+ while(PlatformInfosList[i].info != info)
i++;
- QString s = SystemInfosList[i].name;
+ if (platform.isEmpty())
+ platform = RbSettings::value(RbSettings::CurrentPlatform).toString();
+
+ QString s = PlatformInfosList[i].name;
s.replace(":platform:", platform);
- QString d = SystemInfosList[i].def;
+ QString d = PlatformInfosList[i].def;
d.replace(":platform:", platform);
LOG_INFO() << "GET P:" << s << systemInfos->value(s, d).toString();
return systemInfos->value(s, d);