summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/test/stubs
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/test/stubs')
-rw-r--r--rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp71
1 files changed, 71 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp b/rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp
index eb1ba6157b..c223dee555 100644
--- a/rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp
+++ b/rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp
@@ -23,6 +23,77 @@
#include "rbsettings.h"
#include "systeminfo.h"
+QVariant SystemInfo::platformValue(SystemInfo::PlatformInfo info, QString platform)
+{
+ switch(info) {
+ case SystemInfo::Manual:
+ if (platform == "iriverh120") return "iriverh100";
+ if (platform == "ipodmini2g") return "ipodmini1g";
+ break;
+ case SystemInfo::BuildserverModel:
+ return platform.split('.').at(0);
+ default:
+ return QString();
+ }
+ return QString();
+}
+
+QVariant SystemInfo::value(SystemInfo::SystemInfos info)
+{
+ switch(info) {
+ case SystemInfo::ManualUrl:
+ //return QString("https://unittest/manual/rockbox-%MODEL%%FORMAT%");
+ return QString("https://unittest/manual/%MANUALBASENAME%.%EXTENSION%");
+ break;
+ case SystemInfo::BleedingUrl:
+ return QString("https://unittest/dev/rockbox-%MODEL%.zip");
+ break;
+ case SystemInfo::DailyUrl:
+ return QString("https://unittest/daily/rockbox-%MODEL%-%RELVERSION%.zip");
+ break;
+ case SystemInfo::ReleaseUrl:
+ return QString("https://unittest/release/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip");
+ break;
+ default:
+ return QString();
+ }
+}
+
+QStringList SystemInfo::platforms(SystemInfo::PlatformType type, QString variant)
+{
+ // stub implementation: we have a fixed list of players, and only iaudiox5
+ // has variant iaudiox5.v
+ QStringList result;
+ result << "iriverh100" << "iriverh120" << "iriverh300"
+ << "ipodmini2g" << "archosrecorder" << "archosfmrecorder"
+ << "gigabeatfx" << "iaudiom3" << "sansae200" << "iriverh10";
+ switch (type)
+ {
+ case SystemInfo::PlatformBaseDisabled:
+ // return base platforms only, i.e. return iaudiox5 for iaudiox5.v
+ result << "iaudiox5";
+ break;
+ case SystemInfo::PlatformVariantDisabled:
+ // return variants for the passed variant
+ if (variant == "iaudiox5") {
+ result.clear();
+ result << "iaudiox5" << "iaudiox5.v";
+ }
+ else {
+ result.clear();
+ result << variant;
+ }
+ break;
+ case SystemInfo::PlatformAllDisabled:
+ // return all, both with and without variant.
+ result << "iaudiox5" << "iaudiox5.v";
+ break;
+ default:
+ break;
+ }
+ return result;
+}
+
QVariant RbSettings::value(UserSettings setting)
{