diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-08-08 00:02:33 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-08-08 00:02:33 +0000 |
commit | 89e5333bc18e0e2fcb0ed541a8bfa9479cbe830a (patch) | |
tree | 55afbef87223b853e33f0ca8821a667a01da60d2 | |
parent | 059255705b8e7e7eb787f74ad617cfbc190a2910 (diff) | |
download | rockbox-89e5333bc18e0e2fcb0ed541a8bfa9479cbe830a.tar.gz rockbox-89e5333bc18e0e2fcb0ed541a8bfa9479cbe830a.zip |
Move download link pattern description to rbutil.ini.
Don't hard code the creation of the download links anymore but use pattern replacement and define the basic structure in rbutil.ini.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22200 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | rbutil/rbutilqt/install.cpp | 21 | ||||
-rw-r--r-- | rbutil/rbutilqt/install.h | 1 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutil.ini | 6 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 8 |
4 files changed, 14 insertions, 22 deletions
diff --git a/rbutil/rbutilqt/install.cpp b/rbutil/rbutilqt/install.cpp index 099575fec4..e410222636 100644 --- a/rbutil/rbutilqt/install.cpp +++ b/rbutil/rbutilqt/install.cpp | |||
@@ -103,27 +103,17 @@ void Install::accept() | |||
103 | QString myversion; | 103 | QString myversion; |
104 | QString buildname = RbSettings::value(RbSettings::CurBuildserverModel).toString(); | 104 | QString buildname = RbSettings::value(RbSettings::CurBuildserverModel).toString(); |
105 | if(ui.radioStable->isChecked()) { | 105 | if(ui.radioStable->isChecked()) { |
106 | file = QString("%1/%2/rockbox-%3-%4.zip") | 106 | file = RbSettings::value(RbSettings::ReleaseUrl).toString(); |
107 | .arg(RbSettings::value(RbSettings::ReleaseUrl).toString(), version.value("rel_rev"), | ||
108 | buildname, version.value("rel_rev")); | ||
109 | fileName = QString("rockbox-%1-%2.zip") | ||
110 | .arg(version.value("rel_rev"), buildname); | ||
111 | RbSettings::setValue(RbSettings::Build, "stable"); | 107 | RbSettings::setValue(RbSettings::Build, "stable"); |
112 | myversion = version.value("rel_rev"); | 108 | myversion = version.value("rel_rev"); |
113 | } | 109 | } |
114 | else if(ui.radioArchived->isChecked()) { | 110 | else if(ui.radioArchived->isChecked()) { |
115 | file = QString("%1%2/rockbox-%3-%4.zip") | 111 | file = RbSettings::value(RbSettings::DailyUrl).toString(); |
116 | .arg(RbSettings::value(RbSettings::DailyUrl).toString(), | ||
117 | buildname, buildname, version.value("arch_date")); | ||
118 | fileName = QString("rockbox-%1-%2.zip") | ||
119 | .arg(buildname, version.value("arch_date")); | ||
120 | RbSettings::setValue(RbSettings::Build, "archived"); | 112 | RbSettings::setValue(RbSettings::Build, "archived"); |
121 | myversion = "r" + version.value("arch_rev") + "-" + version.value("arch_date"); | 113 | myversion = "r" + version.value("arch_rev") + "-" + version.value("arch_date"); |
122 | } | 114 | } |
123 | else if(ui.radioCurrent->isChecked()) { | 115 | else if(ui.radioCurrent->isChecked()) { |
124 | file = QString("%1%2/rockbox.zip") | 116 | file = RbSettings::value(RbSettings::BleedingUrl).toString(); |
125 | .arg(RbSettings::value(RbSettings::BleedingUrl).toString(), buildname); | ||
126 | fileName = QString("rockbox.zip"); | ||
127 | RbSettings::setValue(RbSettings::Build, "current"); | 117 | RbSettings::setValue(RbSettings::Build, "current"); |
128 | myversion = "r" + version.value("bleed_rev"); | 118 | myversion = "r" + version.value("bleed_rev"); |
129 | } | 119 | } |
@@ -131,6 +121,11 @@ void Install::accept() | |||
131 | qDebug() << "[Install] no build selected -- this shouldn't happen"; | 121 | qDebug() << "[Install] no build selected -- this shouldn't happen"; |
132 | return; | 122 | return; |
133 | } | 123 | } |
124 | file.replace("%MODEL%", buildname); | ||
125 | file.replace("%RELVERSION%", version.value("rel_rev")); | ||
126 | file.replace("%REVISION%", version.value("arch_rev")); | ||
127 | file.replace("%DATE%", version.value("arch_date")); | ||
128 | |||
134 | RbSettings::sync(); | 129 | RbSettings::sync(); |
135 | 130 | ||
136 | QString warning = Detect::check(false); | 131 | QString warning = Detect::check(false); |
diff --git a/rbutil/rbutilqt/install.h b/rbutil/rbutilqt/install.h index 2a8ec891de..4ac6f281af 100644 --- a/rbutil/rbutilqt/install.h +++ b/rbutil/rbutilqt/install.h | |||
@@ -44,7 +44,6 @@ class Install : public QDialog | |||
44 | QHttp *download; | 44 | QHttp *download; |
45 | QFile *target; | 45 | QFile *target; |
46 | QString file; | 46 | QString file; |
47 | QString fileName; | ||
48 | ZipInstaller* installer; | 47 | ZipInstaller* installer; |
49 | QMap<QString, QString> version; | 48 | QMap<QString, QString> version; |
50 | QString m_backupName; | 49 | QString m_backupName; |
diff --git a/rbutil/rbutilqt/rbutil.ini b/rbutil/rbutilqt/rbutil.ini index 942ea222d6..0922a4fdd4 100644 --- a/rbutil/rbutilqt/rbutil.ini +++ b/rbutil/rbutilqt/rbutil.ini | |||
@@ -1,7 +1,7 @@ | |||
1 | [general] | 1 | [general] |
2 | release_url=http://download.rockbox.org/release/ | 2 | release_url=http://download.rockbox.org/release/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip |
3 | daily_url=http://download.rockbox.org/daily/ | 3 | daily_url=http://download.rockbox.org/daily/%MODEL%/rockbox-%MODEL%.zip |
4 | bleeding_url=http://build.rockbox.org/dist/build- | 4 | bleeding_url=http://build.rockbox.org/data/rockbox-%MODEL%.zip |
5 | server_conf_url=http://www.rockbox.org/daily/build-info | 5 | server_conf_url=http://www.rockbox.org/daily/build-info |
6 | bootloader_info_url=http://download.rockbox.org/bootloader/bootloaders-info | 6 | bootloader_info_url=http://download.rockbox.org/bootloader/bootloaders-info |
7 | bleeding_info=http://build.rockbox.org/cvsmod/build-info | 7 | bleeding_info=http://build.rockbox.org/cvsmod/build-info |
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index c8513b1187..4c4003fcc2 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp | |||
@@ -518,11 +518,9 @@ void RbUtilQt::installBtn() | |||
518 | 518 | ||
519 | bool RbUtilQt::installAuto() | 519 | bool RbUtilQt::installAuto() |
520 | { | 520 | { |
521 | QString file = QString("%1/%2/rockbox-%3-%4.zip") | 521 | QString file = RbSettings::value(RbSettings::ReleaseUrl).toString(); |
522 | .arg(RbSettings::value(RbSettings::ReleaseUrl).toString(), | 522 | file.replace("%MODEL%", RbSettings::value(RbSettings::CurBuildserverModel).toString()); |
523 | versmap.value("rel_rev"), | 523 | file.replace("%RELVERSION%", versmap.value("rel_rev")); |
524 | RbSettings::value(RbSettings::CurBuildserverModel).toString(), | ||
525 | versmap.value("rel_rev")); | ||
526 | buildInfo.open(); | 524 | buildInfo.open(); |
527 | QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); | 525 | QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); |
528 | buildInfo.close(); | 526 | buildInfo.close(); |