summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2020-11-15 21:23:02 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2020-11-15 21:24:51 +0100
commit6c2780e70916dea5159aad6b7de815beef769c85 (patch)
tree7e84be9b8957fb1b623ec44515776aa7ae1fe725 /rbutil/rbutilqt
parent9bb60b7d854734475727f7566ae8d8dbb9d46fdb (diff)
downloadrockbox-6c2780e70916dea5159aad6b7de815beef769c85.tar.gz
rockbox-6c2780e70916dea5159aad6b7de815beef769c85.tar.bz2
rockbox-6c2780e70916dea5159aad6b7de815beef769c85.zip
rbutil: Rework server info data handling.
Allow constructing release candidate URL from configuration the same way we construct the URL for releases. Note that the server path used does not exist, taken from old release candidate builds not available anymore. Change-Id: I7332f08df05ed39724b4900556aaa1f5e0ba463b
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r--rbutil/rbutilqt/base/serverinfo.cpp13
-rw-r--r--rbutil/rbutilqt/base/systeminfo.cpp1
-rw-r--r--rbutil/rbutilqt/base/systeminfo.h1
-rw-r--r--rbutil/rbutilqt/rbutil.ini1
-rw-r--r--rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp3
-rw-r--r--rbutil/rbutilqt/test/test-serverinfo.cpp4
6 files changed, 14 insertions, 9 deletions
diff --git a/rbutil/rbutilqt/base/serverinfo.cpp b/rbutil/rbutilqt/base/serverinfo.cpp
index 94c369af72..84aa89039d 100644
--- a/rbutil/rbutilqt/base/serverinfo.cpp
+++ b/rbutil/rbutilqt/base/serverinfo.cpp
@@ -85,22 +85,21 @@ QVariant ServerInfo::platformValue(enum ServerInfos info, QString platform)
value = value.toStringList().at(0);
break;
case CurReleaseUrl:
+ case RelCandidateUrl:
{
QString version = value.toStringList().at(0);
if(value.toStringList().size() > 1)
value = value.toStringList().at(1);
- else if(!version.isEmpty()) // if value is empty, return empty url.
+ else if(!version.isEmpty() && info == CurReleaseUrl)
value = SystemInfo::value(SystemInfo::ReleaseUrl).toString()
.replace("%MODEL%", platform)
.replace("%RELVERSION%", version);
+ else if(!version.isEmpty() && info == RelCandidateUrl)
+ value = SystemInfo::value(SystemInfo::CandidateUrl).toString()
+ .replace("%MODEL%", platform)
+ .replace("%RELVERSION%", version);
}
break;
- case RelCandidateUrl:
- if(value.toStringList().size() > 1)
- value = value.toStringList().at(1);
- else
- value.clear();
- break;
case CurDevelUrl:
value = SystemInfo::value(SystemInfo::BleedingUrl).toString()
.replace("%MODEL%", platform);
diff --git a/rbutil/rbutilqt/base/systeminfo.cpp b/rbutil/rbutilqt/base/systeminfo.cpp
index d14c3f5436..dee69a2e1e 100644
--- a/rbutil/rbutilqt/base/systeminfo.cpp
+++ b/rbutil/rbutilqt/base/systeminfo.cpp
@@ -42,6 +42,7 @@ const static struct {
{ SystemInfo::Wolf3DUrl, "wolf3d_url" },
{ SystemInfo::XWorldUrl, "xworld_url" },
{ SystemInfo::ReleaseUrl, "release_url" },
+ { SystemInfo::CandidateUrl, "rc_url" },
{ SystemInfo::DailyUrl, "daily_url" },
{ SystemInfo::BuildInfoUrl, "build_info_url" },
{ SystemInfo::GenlangUrl, "genlang_url" },
diff --git a/rbutil/rbutilqt/base/systeminfo.h b/rbutil/rbutilqt/base/systeminfo.h
index 52b50ec4d7..c4afe4b27d 100644
--- a/rbutil/rbutilqt/base/systeminfo.h
+++ b/rbutil/rbutilqt/base/systeminfo.h
@@ -50,6 +50,7 @@ class SystemInfo : public QObject
Wolf3DUrl,
XWorldUrl,
ReleaseUrl,
+ CandidateUrl,
ReleaseVoiceUrl,
ReleaseFontUrl,
BuildInfoUrl,
diff --git a/rbutil/rbutilqt/rbutil.ini b/rbutil/rbutilqt/rbutil.ini
index b92ddcd557..93af1bfb1b 100644
--- a/rbutil/rbutilqt/rbutil.ini
+++ b/rbutil/rbutilqt/rbutil.ini
@@ -2,6 +2,7 @@
; builds
release_url=http://download.rockbox.org/release/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip
bleeding_url=http://build.rockbox.org/data/rockbox-%MODEL%.zip
+rc_url=http://download.rockbox.org/release-candidate/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip
; voice files
release_voice_url=http://download.rockbox.org/release/%RELVERSION%/%MODEL%-%RELVERSION%-english.zip
diff --git a/rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp b/rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp
index 7d2016d6bd..38336a7a6f 100644
--- a/rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp
+++ b/rbutil/rbutilqt/test/stubs/stubs-serverinfo.cpp
@@ -53,6 +53,9 @@ QVariant SystemInfo::value(SystemInfo::SystemInfos info)
case SystemInfo::ReleaseUrl:
return QString("https://unittest/release/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip");
break;
+ case SystemInfo::CandidateUrl:
+ return QString("https://unittest/rc/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip");
+ break;
default:
return QString();
}
diff --git a/rbutil/rbutilqt/test/test-serverinfo.cpp b/rbutil/rbutilqt/test/test-serverinfo.cpp
index 3e71a9763a..9aa8306e50 100644
--- a/rbutil/rbutilqt/test/test-serverinfo.cpp
+++ b/rbutil/rbutilqt/test/test-serverinfo.cpp
@@ -83,9 +83,9 @@ const struct testvector testdata[] =
{ "gigabeatfx", ServerInfo::RelCandidateVersion, "f9dce96" },
{ "gigabeatfx", ServerInfo::RelCandidateUrl, "http://dl.rockbox.org/rc/f9dce96/rockbox-gigabeatfx.zip" },
{ "archosfmrecorder", ServerInfo::RelCandidateVersion, "f9dce96" },
- { "archosfmrecorder", ServerInfo::RelCandidateUrl, "" },
+ { "archosfmrecorder", ServerInfo::RelCandidateUrl, "https://unittest/rc/f9dce96/rockbox-archosfmrecorder-f9dce96.zip" },
{ "archosrecorder", ServerInfo::RelCandidateVersion, "f9dce96" },
- { "archosrecorder", ServerInfo::RelCandidateUrl, "" },
+ { "archosrecorder", ServerInfo::RelCandidateUrl, "https://unittest/rc/f9dce96/rockbox-archosrecorder-f9dce96.zip" },
{ "iaudiox5", ServerInfo::RelCandidateVersion, "f9dce96" },
{ "iaudiox5", ServerInfo::RelCandidateUrl, "http://dl.rockbox.org/rc/f9dce96/rockbox-iaudiox5.zip" },
{ "iaudiox5.v", ServerInfo::RelCandidateVersion, "f9dce96" },