summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-06-03 00:50:01 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-06-03 00:50:01 +0200
commitf4b0e316c3da6b4f1693d645cd62bdb57fe2b6c2 (patch)
tree86282c2f8bce481e4c5bf396a9c5357678930788
parentb73c9616830df6337c0c426ca0e4e1a6cd54cdf6 (diff)
downloadrockbox-f4b0e316c3da6b4f1693d645cd62bdb57fe2b6c2.tar.gz
rockbox-f4b0e316c3da6b4f1693d645cd62bdb57fe2b6c2.zip
Update for single build-info file.
The server now provides a single build-info file (instead of two separate ones for development builds and stable releases). Update to use the new file, since it simplifies things. Change-Id: If3b949f4d78eecb54e47622da887f51005f6d155
-rw-r--r--rbutil/rbutilqt/base/serverinfo.cpp23
-rw-r--r--rbutil/rbutilqt/base/serverinfo.h9
-rw-r--r--rbutil/rbutilqt/base/systeminfo.cpp3
-rw-r--r--rbutil/rbutilqt/base/systeminfo.h3
-rw-r--r--rbutil/rbutilqt/gui/manualwidget.cpp4
-rw-r--r--rbutil/rbutilqt/installwindow.cpp1
-rw-r--r--rbutil/rbutilqt/rbutil.ini7
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp41
-rw-r--r--rbutil/rbutilqt/rbutilqt.h1
9 files changed, 21 insertions, 71 deletions
diff --git a/rbutil/rbutilqt/base/serverinfo.cpp b/rbutil/rbutilqt/base/serverinfo.cpp
index e288bbfe34..b60245c3d5 100644
--- a/rbutil/rbutilqt/base/serverinfo.cpp
+++ b/rbutil/rbutilqt/base/serverinfo.cpp
@@ -32,20 +32,20 @@ const static struct {
32} ServerInfoList[] = { 32} ServerInfoList[] = {
33 { ServerInfo::CurReleaseVersion, ":platform:/releaseversion", "" }, 33 { ServerInfo::CurReleaseVersion, ":platform:/releaseversion", "" },
34 { ServerInfo::CurStatus, ":platform:/status", "Unknown" }, 34 { ServerInfo::CurStatus, ":platform:/status", "Unknown" },
35 { ServerInfo::DailyDate, "dailydate", "" },
36 { ServerInfo::BleedingRevision, "bleedingrev", "" }, 35 { ServerInfo::BleedingRevision, "bleedingrev", "" },
37 { ServerInfo::BleedingDate, "bleedingdate", "" }, 36 { ServerInfo::BleedingDate, "bleedingdate", "" },
38}; 37};
39 38
40QMap<QString, QVariant> ServerInfo::serverInfos; 39QMap<QString, QVariant> ServerInfo::serverInfos;
41 40
42void ServerInfo::readBuildInfo(QString file) 41void ServerInfo::readBuildInfo(QString file)
43{ 42{
44 QSettings info(file, QSettings::IniFormat); 43 QSettings info(file, QSettings::IniFormat);
45 44
46 QDate date = QDate::fromString(info.value("dailies/date").toString(), "yyyyMMdd"); 45 setValue(ServerInfo::BleedingRevision,info.value("bleeding/rev"));
47 setValue(ServerInfo::DailyDate,date.toString(Qt::ISODate)); 46 QDateTime date = QDateTime::fromString(info.value("bleeding/timestamp").toString(), "yyyyMMddThhmmssZ");
48 47 setValue(ServerInfo::BleedingDate,date.toString(Qt::ISODate));
48
49 info.beginGroup("release"); 49 info.beginGroup("release");
50 QStringList keys = info.allKeys(); 50 QStringList keys = info.allKeys();
51 info.endGroup(); 51 info.endGroup();
@@ -87,19 +87,10 @@ void ServerInfo::readBuildInfo(QString file)
87 setPlatformValue(variants.at(j), ServerInfo::CurStatus, status); 87 setPlatformValue(variants.at(j), ServerInfo::CurStatus, status);
88 setPlatformValue(variants.at(j), ServerInfo::CurReleaseVersion, release); 88 setPlatformValue(variants.at(j), ServerInfo::CurReleaseVersion, release);
89 } 89 }
90
91 } 90 }
92} 91}
93 92
94void ServerInfo::readBleedingInfo(QString file) 93
95{
96 QSettings info(file, QSettings::IniFormat);
97
98 setValue(ServerInfo::BleedingRevision,info.value("bleeding/rev"));
99 QDateTime date = QDateTime::fromString(info.value("bleeding/timestamp").toString(), "yyyyMMddThhmmssZ");
100 setValue(ServerInfo::BleedingDate,date.toString(Qt::ISODate));
101}
102
103QVariant ServerInfo::value(enum ServerInfos info) 94QVariant ServerInfo::value(enum ServerInfos info)
104{ 95{
105 // locate info item 96 // locate info item
diff --git a/rbutil/rbutilqt/base/serverinfo.h b/rbutil/rbutilqt/base/serverinfo.h
index 37a0953e3d..69aa26f3e6 100644
--- a/rbutil/rbutilqt/base/serverinfo.h
+++ b/rbutil/rbutilqt/base/serverinfo.h
@@ -27,25 +27,22 @@ class ServerInfo : public QObject
27{ 27{
28 Q_OBJECT 28 Q_OBJECT
29 public: 29 public:
30 30
31 //! All Server infos 31 //! All Server infos
32 enum ServerInfos { 32 enum ServerInfos {
33 CurReleaseVersion, 33 CurReleaseVersion,
34 CurStatus, 34 CurStatus,
35 DailyDate,
36 BleedingRevision, 35 BleedingRevision,
37 BleedingDate, 36 BleedingDate,
38 }; 37 };
39 38
40 //! read in buildinfo file 39 //! read in buildinfo file
41 static void readBuildInfo(QString file); 40 static void readBuildInfo(QString file);
42 //! read in bleeding info file
43 static void readBleedingInfo(QString file);
44 //! get a value from server info 41 //! get a value from server info
45 static QVariant value(enum ServerInfos setting); 42 static QVariant value(enum ServerInfos setting);
46 //! get a value from server info for a named platform. 43 //! get a value from server info for a named platform.
47 static QVariant platformValue(QString platform, enum ServerInfos setting); 44 static QVariant platformValue(QString platform, enum ServerInfos setting);
48 45
49 private: 46 private:
50 //! set a server info value 47 //! set a server info value
51 static void setValue(enum ServerInfos setting , QVariant value); 48 static void setValue(enum ServerInfos setting , QVariant value);
diff --git a/rbutil/rbutilqt/base/systeminfo.cpp b/rbutil/rbutilqt/base/systeminfo.cpp
index 44bcf3c84d..eddfb26b34 100644
--- a/rbutil/rbutilqt/base/systeminfo.cpp
+++ b/rbutil/rbutilqt/base/systeminfo.cpp
@@ -43,12 +43,11 @@ const static struct {
43 { SystemInfo::DoomUrl, "doom_url", "" }, 43 { SystemInfo::DoomUrl, "doom_url", "" },
44 { SystemInfo::ReleaseUrl, "release_url", "" }, 44 { SystemInfo::ReleaseUrl, "release_url", "" },
45 { SystemInfo::DailyUrl, "daily_url", "" }, 45 { SystemInfo::DailyUrl, "daily_url", "" },
46 { SystemInfo::ServerConfUrl, "server_conf_url", "" }, 46 { SystemInfo::BuildInfoUrl, "build_info_url", "" },
47 { SystemInfo::GenlangUrl, "genlang_url", "" }, 47 { SystemInfo::GenlangUrl, "genlang_url", "" },
48 { SystemInfo::ThemesUrl, "themes_url", "" }, 48 { SystemInfo::ThemesUrl, "themes_url", "" },
49 { SystemInfo::ThemesInfoUrl, "themes_info_url", "" }, 49 { SystemInfo::ThemesInfoUrl, "themes_info_url", "" },
50 { SystemInfo::RbutilUrl, "rbutil_url", "" }, 50 { SystemInfo::RbutilUrl, "rbutil_url", "" },
51 { SystemInfo::BleedingInfo, "bleeding_info", "" },
52 { SystemInfo::CurPlatformName, ":platform:/name", "" }, 51 { SystemInfo::CurPlatformName, ":platform:/name", "" },
53 { SystemInfo::CurManual, ":platform:/manualname","rockbox-:platform:" }, 52 { SystemInfo::CurManual, ":platform:/manualname","rockbox-:platform:" },
54 { SystemInfo::CurBootloaderMethod, ":platform:/bootloadermethod", "none" }, 53 { SystemInfo::CurBootloaderMethod, ":platform:/bootloadermethod", "none" },
diff --git a/rbutil/rbutilqt/base/systeminfo.h b/rbutil/rbutilqt/base/systeminfo.h
index 420dbf3c80..9eddd5ed38 100644
--- a/rbutil/rbutilqt/base/systeminfo.h
+++ b/rbutil/rbutilqt/base/systeminfo.h
@@ -47,12 +47,11 @@ class SystemInfo : public QObject
47 ReleaseUrl, 47 ReleaseUrl,
48 ReleaseVoiceUrl, 48 ReleaseVoiceUrl,
49 ReleaseFontUrl, 49 ReleaseFontUrl,
50 ServerConfUrl, 50 BuildInfoUrl,
51 GenlangUrl, 51 GenlangUrl,
52 ThemesUrl, 52 ThemesUrl,
53 ThemesInfoUrl, 53 ThemesInfoUrl,
54 RbutilUrl, 54 RbutilUrl,
55 BleedingInfo,
56 CurPlatformName, 55 CurPlatformName,
57 CurManual, 56 CurManual,
58 CurBootloaderMethod, 57 CurBootloaderMethod,
diff --git a/rbutil/rbutilqt/gui/manualwidget.cpp b/rbutil/rbutilqt/gui/manualwidget.cpp
index ae38980479..7be9145162 100644
--- a/rbutil/rbutilqt/gui/manualwidget.cpp
+++ b/rbutil/rbutilqt/gui/manualwidget.cpp
@@ -104,8 +104,6 @@ void ManualWidget::downloadManual(void)
104 manual = "rockbox-" + SystemInfo::value(SystemInfo::CurBuildserverModel).toString(); 104 manual = "rockbox-" + SystemInfo::value(SystemInfo::CurBuildserverModel).toString();
105 } 105 }
106 106
107 QDate date = QDate::fromString(ServerInfo::value(
108 ServerInfo::DailyDate).toString(), Qt::ISODate);
109 QString manualurl; 107 QString manualurl;
110 108
111 ProgressLoggerGui* logger = new ProgressLoggerGui(this); 109 ProgressLoggerGui* logger = new ProgressLoggerGui(this);
@@ -123,7 +121,7 @@ void ManualWidget::downloadManual(void)
123 else { 121 else {
124 manualurl = manualUrl(ManualZip); 122 manualurl = manualUrl(ManualZip);
125 installer->setLogSection("Manual (HTML)"); 123 installer->setLogSection("Manual (HTML)");
126 installer->setTarget("/" + manual + "-" + date.toString("yyyyMMdd") + "-html.zip"); 124 installer->setTarget("/" + manual + "-" + "-html.zip");
127 } 125 }
128 qDebug() << "[ManualWidget] Manual URL:" << manualurl; 126 qDebug() << "[ManualWidget] Manual URL:" << manualurl;
129 127
diff --git a/rbutil/rbutilqt/installwindow.cpp b/rbutil/rbutilqt/installwindow.cpp
index 8abc342690..7a78154561 100644
--- a/rbutil/rbutilqt/installwindow.cpp
+++ b/rbutil/rbutilqt/installwindow.cpp
@@ -144,7 +144,6 @@ void InstallWindow::accept()
144 } 144 }
145 file.replace("%MODEL%", buildname); 145 file.replace("%MODEL%", buildname);
146 file.replace("%RELVERSION%", ServerInfo::value(ServerInfo::CurReleaseVersion).toString()); 146 file.replace("%RELVERSION%", ServerInfo::value(ServerInfo::CurReleaseVersion).toString());
147 file.replace("%DATE%", ServerInfo::value(ServerInfo::DailyDate).toString());
148 147
149 RbSettings::sync(); 148 RbSettings::sync();
150 149
diff --git a/rbutil/rbutilqt/rbutil.ini b/rbutil/rbutilqt/rbutil.ini
index 4f0bf19e12..fd3605ac9d 100644
--- a/rbutil/rbutilqt/rbutil.ini
+++ b/rbutil/rbutilqt/rbutil.ini
@@ -1,12 +1,10 @@
1[general] 1[general]
2; builds 2; builds
3release_url=http://download.rockbox.org/release/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip 3release_url=http://download.rockbox.org/release/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip
4daily_url=http://download.rockbox.org/daily/%MODEL%/rockbox-%MODEL%.zip
5bleeding_url=http://build.rockbox.org/data/rockbox-%MODEL%.zip 4bleeding_url=http://build.rockbox.org/data/rockbox-%MODEL%.zip
6 5
7; voice files 6; voice files
8release_voice_url=http://download.rockbox.org/release/%RELVERSION%/%MODEL%-%RELVERSION%-english.zip 7release_voice_url=http://download.rockbox.org/release/%RELVERSION%/%MODEL%-%RELVERSION%-english.zip
9daily_voice_url=http://download.rockbox.org/daily/voices/%MODEL%-%DATE%-english.zip
10genlang_url=http://www.rockbox.org/genlang/?lang=%LANG%&t=%TARGET%&rev=%REVISION%&f=%FEATURES% 8genlang_url=http://www.rockbox.org/genlang/?lang=%LANG%&t=%TARGET%&rev=%REVISION%&f=%FEATURES%
11 9
12; bootloader 10; bootloader
@@ -18,15 +16,14 @@ themes_url=http://themes.rockbox.org/
18themes_info_url=http://themes.rockbox.org/rbutilqt.php?target=%TARGET%&release=%RELEASE%&revision=%REVISION%&rbutilver=%RBUTILVER% 16themes_info_url=http://themes.rockbox.org/rbutilqt.php?target=%TARGET%&release=%RELEASE%&revision=%REVISION%&rbutilver=%RBUTILVER%
19 17
20; server information 18; server information
21server_conf_url=http://download.rockbox.org/daily/build-info 19build_info_url=http://download.rockbox.org/build-info
22bleeding_info=http://build.rockbox.org/cvsmod/build-info
23 20
24; fonts 21; fonts
25release_font_url=http://download.rockbox.org/release/%RELEASEVER%/rockbox-fonts-%RELEASEVER%.zip 22release_font_url=http://download.rockbox.org/release/%RELEASEVER%/rockbox-fonts-%RELEASEVER%.zip
26daily_font_url=http://download.rockbox.org/daily/fonts/rockbox-fonts.zip 23daily_font_url=http://download.rockbox.org/daily/fonts/rockbox-fonts.zip
27 24
28; other 25; other
29manual_url=http://download.rockbox.org/daily/manual/%MANUALBASENAME%.%EXTENSION% 26manual_url=http://download.rockbox.org/manual/%MANUALBASENAME%.%EXTENSION%
30doom_url=http://download.rockbox.org/useful/rockdoom.zip 27doom_url=http://download.rockbox.org/useful/rockdoom.zip
31rbutil_url=http://download.rockbox.org/rbutil/ 28rbutil_url=http://download.rockbox.org/rbutil/
32 29
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 9c72f13d05..279b73b5be 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -227,7 +227,7 @@ void RbUtilQt::downloadInfo()
227 ui.statusbar->showMessage(tr("Downloading build information, please wait ...")); 227 ui.statusbar->showMessage(tr("Downloading build information, please wait ..."));
228 qDebug() << "[RbUtil] downloading build info"; 228 qDebug() << "[RbUtil] downloading build info";
229 daily->setFile(&buildInfo); 229 daily->setFile(&buildInfo);
230 daily->getFile(QUrl(SystemInfo::value(SystemInfo::ServerConfUrl).toString())); 230 daily->getFile(QUrl(SystemInfo::value(SystemInfo::BuildInfoUrl).toString()));
231} 231}
232 232
233 233
@@ -249,42 +249,13 @@ void RbUtilQt::downloadDone(bool error)
249 ServerInfo::readBuildInfo(buildInfo.fileName()); 249 ServerInfo::readBuildInfo(buildInfo.fileName());
250 buildInfo.close(); 250 buildInfo.close();
251 251
252 // start bleeding info download 252 ui.statusbar->showMessage(tr("Download build information finished."), 5000);
253 bleeding = new HttpGet(this); 253 updateSettings();
254 connect(bleeding, SIGNAL(done(bool)), this, SLOT(downloadBleedingDone(bool))); 254 m_gotInfo = true;
255 connect(qApp, SIGNAL(lastWindowClosed()), bleeding, SLOT(abort()));
256 if(RbSettings::value(RbSettings::CacheOffline).toBool())
257 bleeding->setCache(true);
258 bleeding->setFile(&bleedingInfo);
259 bleeding->getFile(QUrl(SystemInfo::value(SystemInfo::BleedingInfo).toString()));
260 ui.statusbar->showMessage(tr("Downloading build information, please wait ..."));
261
262}
263
264
265void RbUtilQt::downloadBleedingDone(bool error)
266{
267 if(error) {
268 qDebug() << "[RbUtil] network error:" << bleeding->error();
269 ui.statusbar->showMessage(tr("Can't get version information!"));
270 QMessageBox::critical(this, tr("Network error"),
271 tr("Can't get version information.\n"
272 "Network error: %1. Please check your network and proxy settings.")
273 .arg(bleeding->errorString()));
274 return;
275 }
276 else {
277 bleedingInfo.open();
278 ServerInfo::readBleedingInfo(bleedingInfo.fileName());
279 bleedingInfo.close();
280 255
281 ui.statusbar->showMessage(tr("Download build information finished."), 5000); 256 //start check for updates
282 updateSettings(); 257 checkUpdate();
283 m_gotInfo = true;
284 258
285 //start check for updates
286 checkUpdate();
287 }
288} 259}
289 260
290 261
diff --git a/rbutil/rbutilqt/rbutilqt.h b/rbutil/rbutilqt/rbutilqt.h
index 5c0694a019..67fbff78e1 100644
--- a/rbutil/rbutilqt/rbutilqt.h
+++ b/rbutil/rbutilqt/rbutilqt.h
@@ -105,7 +105,6 @@ class RbUtilQt : public QMainWindow
105 void createTalkFiles(void); 105 void createTalkFiles(void);
106 void createVoiceFile(void); 106 void createVoiceFile(void);
107 void downloadDone(bool); 107 void downloadDone(bool);
108 void downloadBleedingDone(bool);
109 void downloadInfo(void); 108 void downloadInfo(void);
110 109
111 void installVoice(void); 110 void installVoice(void);