1
0
Fork 0
forked from len0rd/rockbox

Move retrieval of revision and release numbers to RockboxInfo class.

This allows reusing retrieval for upcoming distinguishing between release and
current voice files.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26636 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2010-06-06 18:02:01 +00:00
parent be8da842b8
commit b2998ef6c7
3 changed files with 15 additions and 12 deletions

View file

@ -41,6 +41,15 @@ RockboxInfo::RockboxInfo(QString mountpoint)
if(line.contains("Version:"))
{
m_version = line.remove("Version:").trimmed();
if(m_version.startsWith("r")) {
m_revision = m_version;
m_revision.remove("r").replace(QRegExp("-.+$"), "");
m_release = "";
}
else {
m_release = m_version;
m_revision = "";
}
}
else if(line.contains("Target: "))
{

View file

@ -36,8 +36,12 @@ public:
QString target() {return m_target;}
int ram() { return m_ram; }
bool success() { return m_success; }
QString revision(void) { return m_revision; }
QString release(void) { return m_release; }
private:
QString m_version;
QString m_revision;
QString m_release;
QString m_features;
QString m_targetid;
QString m_target;

View file

@ -62,16 +62,6 @@ void ThemesInstallWindow::downloadInfo()
getter = new HttpGet(this);
RockboxInfo installInfo
= RockboxInfo(RbSettings::value(RbSettings::Mountpoint).toString());
QString revision;
QString release;
// installInfo.version() holds either the revision (as r<revision>-<date>)
// or the release version number.
if(installInfo.version().startsWith("r")) {
revision = installInfo.version().remove("r").replace(QRegExp("-.+$"), "");
}
else {
release = installInfo.version();
}
themesInfo.open();
qDebug() << "[Themes] downloading info to" << themesInfo.fileName();
@ -80,8 +70,8 @@ void ThemesInstallWindow::downloadInfo()
QString infoUrl = SystemInfo::value(SystemInfo::ThemesInfoUrl).toString();
infoUrl.replace("%TARGET%",
SystemInfo::value(SystemInfo::CurConfigureModel).toString());
infoUrl.replace("%REVISION%", revision);
infoUrl.replace("%RELEASE%", release);
infoUrl.replace("%REVISION%", installInfo.revision());
infoUrl.replace("%RELEASE%", installInfo.release());
infoUrl.replace("%RBUTILVER%", VERSION);
QUrl url = QUrl(infoUrl);
qDebug() << "[Themes] Info URL:" << url << "Query:" << url.queryItems();