summaryrefslogtreecommitdiffstats
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2020-11-15 21:06:33 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2020-11-15 21:06:33 +0100
commit9bb60b7d854734475727f7566ae8d8dbb9d46fdb (patch)
tree78cf94dce69ef588be27d278a52d1670fdaad007 /rbutil
parent104ff3433a9f26009751cbd317d0024742d1310b (diff)
downloadrockbox-9bb60b7d854734475727f7566ae8d8dbb9d46fdb.tar.gz
rockbox-9bb60b7d854734475727f7566ae8d8dbb9d46fdb.tar.bz2
rockbox-9bb60b7d854734475727f7566ae8d8dbb9d46fdb.zip
rbutil: Rework server info data handling.
Allow extracting release candidate version even if no URL is present. Avoids a special case for version handling. Change-Id: If496d30059c3181899ab9337a35a07b39eaef52e
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutilqt/base/serverinfo.cpp8
-rw-r--r--rbutil/rbutilqt/test/test-serverinfo.cpp4
2 files changed, 3 insertions, 9 deletions
diff --git a/rbutil/rbutilqt/base/serverinfo.cpp b/rbutil/rbutilqt/base/serverinfo.cpp
index c4d51d4431..94c369af72 100644
--- a/rbutil/rbutilqt/base/serverinfo.cpp
+++ b/rbutil/rbutilqt/base/serverinfo.cpp
@@ -81,14 +81,8 @@ QVariant ServerInfo::platformValue(enum ServerInfos info, QString platform)
value = ServerInfo::statusToString(value.toInt());
break;
case CurReleaseVersion:
- value = value.toStringList().at(0);
- break;
case RelCandidateVersion:
- // currently only the <version>,<url> format is supported here.
- if (value.toStringList().size() > 1)
- value = value.toStringList().at(0);
- else
- value.clear();
+ value = value.toStringList().at(0);
break;
case CurReleaseUrl:
{
diff --git a/rbutil/rbutilqt/test/test-serverinfo.cpp b/rbutil/rbutilqt/test/test-serverinfo.cpp
index 46d9637150..3e71a9763a 100644
--- a/rbutil/rbutilqt/test/test-serverinfo.cpp
+++ b/rbutil/rbutilqt/test/test-serverinfo.cpp
@@ -82,9 +82,9 @@ const struct testvector testdata[] =
{ "iriverh10", ServerInfo::CurStatus, "Stable (Retired)" },
{ "gigabeatfx", ServerInfo::RelCandidateVersion, "f9dce96" },
{ "gigabeatfx", ServerInfo::RelCandidateUrl, "http://dl.rockbox.org/rc/f9dce96/rockbox-gigabeatfx.zip" },
- { "archosfmrecorder", ServerInfo::RelCandidateVersion, "" },
+ { "archosfmrecorder", ServerInfo::RelCandidateVersion, "f9dce96" },
{ "archosfmrecorder", ServerInfo::RelCandidateUrl, "" },
- { "archosrecorder", ServerInfo::RelCandidateVersion, "" },
+ { "archosrecorder", ServerInfo::RelCandidateVersion, "f9dce96" },
{ "archosrecorder", ServerInfo::RelCandidateUrl, "" },
{ "iaudiox5", ServerInfo::RelCandidateVersion, "f9dce96" },
{ "iaudiox5", ServerInfo::RelCandidateUrl, "http://dl.rockbox.org/rc/f9dce96/rockbox-iaudiox5.zip" },