diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2010-06-06 18:02:01 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2010-06-06 18:02:01 +0000 |
commit | b2998ef6c7627be0b9cec4acada381eb78779895 (patch) | |
tree | 4e413ffb3d12c50c7155f164c61b5956c1c7aece /rbutil | |
parent | be8da842b831d9575503b07df07f4fc35eda9519 (diff) |
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
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/rbutilqt/base/rockboxinfo.cpp | 9 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/rockboxinfo.h | 4 | ||||
-rw-r--r-- | rbutil/rbutilqt/themesinstallwindow.cpp | 14 |
3 files changed, 15 insertions, 12 deletions
diff --git a/rbutil/rbutilqt/base/rockboxinfo.cpp b/rbutil/rbutilqt/base/rockboxinfo.cpp index f85c23b669..6bfffc1b23 100644 --- a/rbutil/rbutilqt/base/rockboxinfo.cpp +++ b/rbutil/rbutilqt/base/rockboxinfo.cpp @@ -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: ")) { diff --git a/rbutil/rbutilqt/base/rockboxinfo.h b/rbutil/rbutilqt/base/rockboxinfo.h index 4d704f8f72..906da635a9 100644 --- a/rbutil/rbutilqt/base/rockboxinfo.h +++ b/rbutil/rbutilqt/base/rockboxinfo.h @@ -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; diff --git a/rbutil/rbutilqt/themesinstallwindow.cpp b/rbutil/rbutilqt/themesinstallwindow.cpp index 935c703193..cb06b47b1f 100644 --- a/rbutil/rbutilqt/themesinstallwindow.cpp +++ b/rbutil/rbutilqt/themesinstallwindow.cpp @@ -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(); |