summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/systeminfo.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2020-11-28 20:47:28 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2020-12-03 22:25:12 +0100
commitb064a6cbb58a0db1a70fbac2e82242ce0c7509b1 (patch)
treec9090d367d237cbd408afbd24d5809e55a1a2653 /rbutil/rbutilqt/base/systeminfo.cpp
parent78a01db47cac5fa67aeee6f1c5134f89c3e4944a (diff)
downloadrockbox-b064a6cbb5.tar.gz
rockbox-b064a6cbb5.tar.bz2
rockbox-b064a6cbb5.zip
rbutil: Rework and merge player and build server info handling.
Handling the data for players from rbutil.ini and the build-info data from the server is closely related. Splitting things up into different classes only creates tightly coupling, which is unnecessary, and the need to differentiate between them in the application. Merge both classes into a single one and rework handling so the application doesn't have to deal with two separate classes anymore. Furthermore, change URL templates to use new values from build-info instead of hard coding them. Change-Id: Ica550973ce23d1559110782add52bc214eba552d
Diffstat (limited to 'rbutil/rbutilqt/base/systeminfo.cpp')
-rw-r--r--rbutil/rbutilqt/base/systeminfo.cpp85
1 files changed, 0 insertions, 85 deletions
diff --git a/rbutil/rbutilqt/base/systeminfo.cpp b/rbutil/rbutilqt/base/systeminfo.cpp
index 8868ba937b..aa847540b9 100644
--- a/rbutil/rbutilqt/base/systeminfo.cpp
+++ b/rbutil/rbutilqt/base/systeminfo.cpp
@@ -23,44 +23,6 @@
#include "Logger.h"
// device settings
-const static struct {
- SystemInfo::SystemInfos info;
- const char* name;
-} SystemInfosList[] = {
- { SystemInfo::ManualUrl, ":build:/manual_url" },
- { SystemInfo::BuildUrl, ":build:/build_url" },
- { SystemInfo::FontUrl, ":build:/font_url" },
- { SystemInfo::VoiceUrl, ":build:/voice_url" },
- { SystemInfo::BootloaderUrl, "bootloader/download_url" },
- { SystemInfo::BootloaderInfoUrl, "bootloader/info_url" },
- { SystemInfo::DoomUrl, "doom_url" },
- { SystemInfo::Duke3DUrl, "duke3d_url" },
- { SystemInfo::PuzzFontsUrl, "puzzfonts_url" },
- { SystemInfo::QuakeUrl, "quake_url" },
- { SystemInfo::Wolf3DUrl, "wolf3d_url" },
- { SystemInfo::XWorldUrl, "xworld_url" },
- { SystemInfo::BuildInfoUrl, "build_info_url" },
- { SystemInfo::GenlangUrl, "genlang_url" },
- { 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::Manual, ":platform:/manualname", ":platform:" },
- { SystemInfo::BootloaderMethod, ":platform:/bootloadermethod", "none" },
- { SystemInfo::BootloaderName, ":platform:/bootloadername", "" },
- { SystemInfo::BootloaderFile, ":platform:/bootloaderfile", "" },
- { SystemInfo::BootloaderFilter, ":platform:/bootloaderfilter", "" },
- { SystemInfo::Encoder, ":platform:/encoder", "" },
- { SystemInfo::Brand, ":platform:/brand", "" },
- { SystemInfo::Name, ":platform:/name", "" },
- { SystemInfo::PlayerPicture, ":platform:/playerpic", "" },
-};
//! pointer to setting object to nullptr
QSettings* SystemInfo::systemInfos = nullptr;
@@ -76,53 +38,6 @@ void SystemInfo::ensureSystemInfoExists()
}
-QVariant SystemInfo::value(enum SystemInfos info, BuildType type)
-{
- ensureSystemInfoExists();
-
- // locate setting item
- int i = 0;
- while(SystemInfosList[i].info != info)
- i++;
- QString s = SystemInfosList[i].name;
- switch(type) {
- case BuildDaily:
- s.replace(":build:", "daily");
- break;
- case BuildCurrent:
- s.replace(":build:", "development");
- break;
- case BuildCandidate:
- s.replace(":build:", "release-candidate");
- break;
- case BuildRelease:
- s.replace(":build:", "release");
- break;
- }
- LOG_INFO() << "GET:" << s << systemInfos->value(s).toString();
- return systemInfos->value(s);
-}
-
-QVariant SystemInfo::platformValue(enum PlatformInfo info, QString platform)
-{
- ensureSystemInfoExists();
-
- // locate setting item
- int i = 0;
- while(PlatformInfosList[i].info != info)
- i++;
-
- if (platform.isEmpty())
- platform = RbSettings::value(RbSettings::CurrentPlatform).toString();
-
- QString s = PlatformInfosList[i].name;
- s.replace(":platform:", platform);
- QString d = PlatformInfosList[i].def;
- d.replace(":platform:", platform);
- LOG_INFO() << "GET P:" << s << systemInfos->value(s, d).toString();
- return systemInfos->value(s, d);
-}
-
QStringList SystemInfo::platforms(enum SystemInfo::PlatformType type, QString variant)
{
ensureSystemInfoExists();