Advertisement
Guest User

domo

a guest
Jan 24th, 2010
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.97 KB | None | 0 0
  1. Index: rbutil/rbutilqt/base/rbsettings.cpp
  2. ===================================================================
  3. --- rbutil/rbutilqt/base/rbsettings.cpp (revision 24320)
  4. +++ rbutil/rbutilqt/base/rbsettings.cpp (working copy)
  5. @@ -94,24 +94,9 @@
  6. { RbSettings::EncoderVolume, ":encoder:/volume", "1.0" },
  7. };
  8.  
  9. -// server settings
  10. -const static struct {
  11. - RbSettings::ServerSettings setting;
  12. - const char* name;
  13. - const char* def;
  14. -} ServerSettingsList[] = {
  15. - { RbSettings::CurReleaseVersion, ":platform:/releaseversion", "" },
  16. - { RbSettings::CurStatus, ":platform:/status", "" },
  17. - { RbSettings::DailyRevision, "dailyrev", "" },
  18. - { RbSettings::DailyDate, "dailydate", "" },
  19. - { RbSettings::BleedingRevision, "bleedingrev", "" },
  20. - { RbSettings::BleedingDate, "bleedingdate", "" },
  21. -};
  22. -
  23. //! pointer to setting object to NULL
  24. QSettings* RbSettings::systemSettings = NULL;
  25. QSettings* RbSettings::userSettings = NULL;
  26. -QMap<QString, QVariant> RbSettings::serverSettings;
  27.  
  28. void RbSettings::ensureRbSettingsExists()
  29. {
  30. @@ -215,20 +200,6 @@
  31. return userSettings->value(s, UserSettingsList[i].def);
  32. }
  33.  
  34. -QVariant RbSettings::value(enum ServerSettings setting)
  35. -{
  36. - ensureRbSettingsExists();
  37. -
  38. - // locate setting item
  39. - int i = 0;
  40. - while(ServerSettingsList[i].setting != setting)
  41. - i++;
  42. -
  43. - QString s = constructSettingPath(ServerSettingsList[i].name);
  44. - qDebug() << "[Settings] GET SERV:" << s << serverSettings.value(s, ServerSettingsList[i].def).toString();
  45. - return serverSettings.value(s);
  46. -}
  47. -
  48. void RbSettings::setValue(enum UserSettings setting , QVariant value)
  49. {
  50. QString empty;
  51. @@ -249,28 +220,6 @@
  52. qDebug() << "[Settings] SET U:" << s << userSettings->value(s).toString();
  53. }
  54.  
  55. -void RbSettings::setValue(enum ServerSettings setting, QVariant value)
  56. -{
  57. - QString empty;
  58. - return setPlatformValue(empty, setting, value);
  59. -}
  60. -
  61. -void RbSettings::setPlatformValue(QString platform, enum ServerSettings setting, QVariant value)
  62. -{
  63. - ensureRbSettingsExists();
  64. -
  65. - // locate setting item
  66. - int i = 0;
  67. - while(ServerSettingsList[i].setting != setting)
  68. - i++;
  69. -
  70. - QString s = ServerSettingsList[i].name;
  71. - s.replace(":platform:", platform);
  72. - serverSettings.insert(s, value);
  73. - qDebug() << "[Settings] SET SERV:" << s << serverSettings.value(s).toString();
  74. -}
  75. -
  76. -
  77. QVariant RbSettings::platformValue(QString platform, enum SystemSettings setting)
  78. {
  79. ensureRbSettingsExists();
  80. @@ -288,7 +237,6 @@
  81. return systemSettings->value(s, d);
  82. }
  83.  
  84. -
  85. QStringList RbSettings::platforms()
  86. {
  87. ensureRbSettingsExists();
  88. Index: rbutil/rbutilqt/base/rbsettings.h
  89. ===================================================================
  90. --- rbutil/rbutilqt/base/rbsettings.h (revision 24320)
  91. +++ rbutil/rbutilqt/base/rbsettings.h (working copy)
  92. @@ -96,17 +96,7 @@
  93. CurBuildserverModel,
  94. CurConfigureModel,
  95. };
  96. -
  97. - //! All Server settings
  98. - enum ServerSettings {
  99. - CurReleaseVersion,
  100. - CurStatus,
  101. - DailyRevision,
  102. - DailyDate,
  103. - BleedingRevision,
  104. - BleedingDate,
  105. - };
  106. -
  107. +
  108. //! call this to flush the user Settings
  109. static void sync();
  110. //! returns the filename of the usersettings file
  111. @@ -125,20 +115,14 @@
  112. static QVariant value(enum SystemSettings setting);
  113. //! get a value from user settings
  114. static QVariant value(enum UserSettings setting);
  115. - //! get a value from server settings
  116. - static QVariant value(enum ServerSettings setting);
  117. //! set a user setting value
  118. static void setValue(enum UserSettings setting , QVariant value);
  119. - //! set a server setting value
  120. - static void setValue(enum ServerSettings setting , QVariant value);
  121. //! get a user setting from a subvalue (ie for encoders and tts engines)
  122. static QVariant subValue(QString sub, enum UserSettings setting);
  123. //! set a user setting from a subvalue (ie for encoders and tts engines)
  124. static void setSubValue(QString sub, enum UserSettings setting, QVariant value);
  125. - //! set a value for a server settings for a named platform.
  126. - static void setPlatformValue(QString platform, enum ServerSettings setting, QVariant value);
  127. //! get a value from system settings for a named platform.
  128. - static QVariant platformValue(QString platform, enum SystemSettings setting);
  129. + static QVariant platformValue(QString platform, enum SystemSettings setting);
  130.  
  131. private:
  132. //! you shouldnt call this, its a fully static calls
  133. @@ -151,7 +135,6 @@
  134. //! pointers to our setting objects
  135. static QSettings *systemSettings;
  136. static QSettings *userSettings;
  137. - static QMap<QString, QVariant> serverSettings;
  138. };
  139.  
  140. #endif
  141. Index: rbutil/rbutilqt/base/serverinfo.cpp
  142. ===================================================================
  143. --- rbutil/rbutilqt/base/serverinfo.cpp (revision 0)
  144. +++ rbutil/rbutilqt/base/serverinfo.cpp (revision 0)
  145. @@ -0,0 +1,150 @@
  146. +/***************************************************************************
  147. + * __________ __ ___.
  148. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___
  149. + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
  150. + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
  151. + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
  152. + * \/ \/ \/ \/ \/
  153. + *
  154. + * Copyright (C) 2010 by Dominik Wenger
  155. + * $Id$
  156. + *
  157. + * All files in this archive are subject to the GNU General Public License.
  158. + * See the file COPYING in the source tree root for full license agreement.
  159. + *
  160. + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  161. + * KIND, either express or implied.
  162. + *
  163. + ****************************************************************************/
  164. +
  165. +#include "serverinfo.h"
  166. +#include "rbsettings.h"
  167. +
  168. +#include <QSettings>
  169. +
  170. +#if defined(Q_OS_LINUX)
  171. +#include <unistd.h>
  172. +#endif
  173. +
  174. +// server infos
  175. +const static struct {
  176. + ServerInfo::ServerInfos info;
  177. + const char* name;
  178. + const char* def;
  179. +} ServerInfoList[] = {
  180. + { ServerInfo::CurReleaseVersion, ":platform:/releaseversion", "" },
  181. + { ServerInfo::CurStatus, ":platform:/status", "unknown" },
  182. + { ServerInfo::DailyRevision, "dailyrev", "" },
  183. + { ServerInfo::DailyDate, "dailydate", "" },
  184. + { ServerInfo::BleedingRevision, "bleedingrev", "" },
  185. + { ServerInfo::BleedingDate, "bleedingdate", "" },
  186. +};
  187. +
  188. +QMap<QString, QVariant> ServerInfo::serverInfos;
  189. +
  190. +void ServerInfo::readBuildInfo(QString file)
  191. +{
  192. + QSettings info(file, QSettings::IniFormat);
  193. +
  194. + setValue(ServerInfo::DailyRevision,info.value("dailies/rev"));
  195. + QDate date = QDate::fromString(info.value("dailies/date").toString(), "yyyyMMdd");
  196. + setValue(ServerInfo::DailyDate,date.toString(Qt::ISODate));
  197. +
  198. + info.beginGroup("release");
  199. + QStringList keys = info.allKeys();
  200. + for(int i=0; i < keys.size(); i++)
  201. + {
  202. + setAllConfigPlatformValue(keys[i],ServerInfo::CurReleaseVersion,info.value(keys[i]));
  203. + }
  204. + info.endGroup();
  205. +
  206. + info.beginGroup("status");
  207. + keys = info.allKeys();
  208. + for(int i=0; i < keys.size(); i++)
  209. + {
  210. + switch(info.value(keys[i]).toInt())
  211. + {
  212. + case 1:
  213. + ServerInfo::setAllConfigPlatformValue(keys[i],ServerInfo::CurStatus,tr("Unusable"));
  214. + break;
  215. + case 2:
  216. + ServerInfo::setAllConfigPlatformValue(keys[i],ServerInfo::CurStatus,tr("Unstable"));
  217. + break;
  218. + case 3:
  219. + ServerInfo::setAllConfigPlatformValue(keys[i],ServerInfo::CurStatus,tr("Stable"));
  220. + break;
  221. + default:
  222. + ServerInfo::setAllConfigPlatformValue(keys[i],ServerInfo::CurStatus,tr("Unknown"));
  223. + break;
  224. + }
  225. + }
  226. + info.endGroup();
  227. +}
  228. +
  229. +void ServerInfo::readBleedingInfo(QString file)
  230. +{
  231. + QSettings info(file, QSettings::IniFormat);
  232. +
  233. + setValue(ServerInfo::BleedingRevision,info.value("bleeding/rev"));
  234. + QDateTime date = QDateTime::fromString(info.value("bleeding/timestamp").toString(), "yyyyMMddThhmmssZ");
  235. + setValue(ServerInfo::BleedingDate,date.toString(Qt::ISODate));
  236. +}
  237. +
  238. +QVariant ServerInfo::value(enum ServerInfos info)
  239. +{
  240. + // locate info item
  241. + int i = 0;
  242. + while(ServerInfoList[i].info != info)
  243. + i++;
  244. +
  245. + QString s = ServerInfoList[i].name;
  246. + s.replace(":platform:", RbSettings::value(RbSettings::CurrentPlatform).toString());
  247. + qDebug() << "[ServerIndo] GET:" << s << serverInfos.value(s, ServerInfoList[i].def).toString();
  248. + return serverInfos.value(s, ServerInfoList[i].def);
  249. +}
  250. +
  251. +void ServerInfo::setValue(enum ServerInfos setting, QVariant value)
  252. +{
  253. + QString empty;
  254. + return setPlatformValue(empty, setting, value);
  255. +}
  256. +
  257. +void ServerInfo::setPlatformValue(QString platform, enum ServerInfos info, QVariant value)
  258. +{
  259. + // locate setting item
  260. + int i = 0;
  261. + while(ServerInfoList[i].info != info)
  262. + i++;
  263. +
  264. + QString s = ServerInfoList[i].name;
  265. + s.replace(":platform:", platform);
  266. + serverInfos.insert(s, value);
  267. + qDebug() << "[ServerInfo] SET:" << s << serverInfos.value(s).toString();
  268. +}
  269. +
  270. +void ServerInfo::setAllConfigPlatformValue(QString configplatform, ServerInfos info, QVariant value)
  271. +{
  272. + // insert intp all platforms where configurename matches
  273. + QStringList platforms = RbSettings::platforms();
  274. + for(int i =0; i < platforms.size(); i++)
  275. + {
  276. + if(RbSettings::platformValue(platforms.at(i),RbSettings::CurConfigureModel) == configplatform)
  277. + setPlatformValue(platforms.at(i),info,value);
  278. + }
  279. +}
  280. +
  281. +QVariant ServerInfo::platformValue(QString platform, enum ServerInfos info)
  282. +{
  283. + // locate setting item
  284. + int i = 0;
  285. + while(ServerInfoList[i].info != info)
  286. + i++;
  287. +
  288. + QString s = ServerInfoList[i].name;
  289. + s.replace(":platform:", platform);
  290. + QString d = ServerInfoList[i].def;
  291. + d.replace(":platform:", platform);
  292. + qDebug() << "[ServerInfo] GET" << s << serverInfos.value(s, d).toString();
  293. + return serverInfos.value(s, d);
  294. +}
  295. +
  296.  
  297. Property changes on: rbutil\rbutilqt\base\serverinfo.cpp
  298. ___________________________________________________________________
  299. Added: svn:keywords
  300. + Author Date Id Revision
  301. Added: svn:eol-style
  302. + native
  303.  
  304. Index: rbutil/rbutilqt/base/serverinfo.h
  305. ===================================================================
  306. --- rbutil/rbutilqt/base/serverinfo.h (revision 0)
  307. +++ rbutil/rbutilqt/base/serverinfo.h (revision 0)
  308. @@ -0,0 +1,69 @@
  309. +/***************************************************************************
  310. + * __________ __ ___.
  311. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___
  312. + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
  313. + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
  314. + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
  315. + * \/ \/ \/ \/ \/
  316. + *
  317. + * Copyright (C) 2010 by Dominik Wenger
  318. + * $Id$
  319. + *
  320. + * This program is free software; you can redistribute it and/or
  321. + * modify it under the terms of the GNU General Public License
  322. + * as published by the Free Software Foundation; either version 2
  323. + * of the License, or (at your option) any later version.
  324. + *
  325. + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  326. + * KIND, either express or implied.
  327. + *
  328. + ****************************************************************************/
  329. +
  330. +#ifndef SERVERINFO_H
  331. +#define SERVERINFO_H
  332. +
  333. +#include <QtCore>
  334. +
  335. +class QSettings;
  336. +
  337. +class ServerInfo : public QObject
  338. +{
  339. + Q_OBJECT
  340. + public:
  341. +
  342. + //! All Server infos
  343. + enum ServerInfos {
  344. + CurReleaseVersion,
  345. + CurStatus,
  346. + DailyRevision,
  347. + DailyDate,
  348. + BleedingRevision,
  349. + BleedingDate,
  350. + };
  351. +
  352. + //! read in buildinfo file
  353. + static void readBuildInfo(QString file);
  354. + //! read in bleeding info file
  355. + static void readBleedingInfo(QString file);
  356. + //! get a value from server info
  357. + static QVariant value(enum ServerInfos setting);
  358. + //! get a value from server info for a named platform.
  359. + static QVariant platformValue(QString platform, enum ServerInfos setting);
  360. +
  361. + private:
  362. + //! set a server info to all platforms where configurename matches
  363. + static void setAllConfigPlatformValue(QString configplatform,ServerInfos info, QVariant value);
  364. + //! set a server info value
  365. + static void setValue(enum ServerInfos setting , QVariant value);
  366. + //! set a value for a server info for a named platform.
  367. + static void setPlatformValue(QString platform, enum ServerInfos setting, QVariant value);
  368. + //! you shouldnt call this, its a fully static class
  369. + ServerInfo() {}
  370. +
  371. + //! map of server infos
  372. + static QMap<QString, QVariant> serverInfos;
  373. +
  374. +};
  375. +
  376. +#endif
  377. +
  378.  
  379. Property changes on: rbutil\rbutilqt\base\serverinfo.h
  380. ___________________________________________________________________
  381. Added: svn:keywords
  382. + Author Date Id Revision
  383. Added: svn:eol-style
  384. + native
  385.  
  386. Index: rbutil/rbutilqt/configure.cpp
  387. ===================================================================
  388. --- rbutil/rbutilqt/configure.cpp (revision 24320)
  389. +++ rbutil/rbutilqt/configure.cpp (working copy)
  390. @@ -29,6 +29,7 @@
  391. #include "system.h"
  392. #include "encttscfggui.h"
  393. #include "rbsettings.h"
  394. +#include "serverinfo.h"
  395. #include "utils.h"
  396. #include <stdio.h>
  397. #if defined(Q_OS_WIN32)
  398. @@ -292,7 +293,8 @@
  399. QMap <QString, QString> devcs;
  400. for(int it = 0; it < platformList.size(); it++)
  401. {
  402. - QString curname = RbSettings::name(platformList.at(it));
  403. + QString curname = RbSettings::name(platformList.at(it)) +
  404. + " (" +ServerInfo::platformValue(platformList.at(it),ServerInfo::CurStatus).toString() + ")";
  405. QString curbrand = RbSettings::brand(platformList.at(it));
  406. manuf.insertMulti(curbrand, platformList.at(it));
  407. devcs.insert(platformList.at(it), curname);
  408. @@ -321,7 +323,8 @@
  409. // go through platforms again for sake of order
  410. for(int it = 0; it < platformList.size(); it++) {
  411.  
  412. - QString curname = RbSettings::name(platformList.at(it));
  413. + QString curname = RbSettings::name(platformList.at(it)) +
  414. + " (" +ServerInfo::platformValue(platformList.at(it),ServerInfo::CurStatus).toString() +")";
  415. QString curbrand = RbSettings::brand(platformList.at(it));
  416.  
  417. if(curbrand != brands.at(c)) continue;
  418. Index: rbutil/rbutilqt/installwindow.cpp
  419. ===================================================================
  420. --- rbutil/rbutilqt/installwindow.cpp (revision 24320)
  421. +++ rbutil/rbutilqt/installwindow.cpp (working copy)
  422. @@ -22,6 +22,7 @@
  423. #include "rbzip.h"
  424. #include "system.h"
  425. #include "rbsettings.h"
  426. +#include "serverinfo.h"
  427. #include "utils.h"
  428.  
  429. InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
  430. @@ -54,24 +55,24 @@
  431. backupCheckboxChanged(Qt::Unchecked);
  432.  
  433.  
  434. - if(RbSettings::value(RbSettings::DailyRevision).toString().isEmpty()) {
  435. + if(ServerInfo::value(ServerInfo::DailyRevision).toString().isEmpty()) {
  436. ui.radioArchived->setEnabled(false);
  437. qDebug() << "[Install] no information about archived version available!";
  438. }
  439. - if(RbSettings::value(RbSettings::CurReleaseVersion).toString().isEmpty()) {
  440. + if(ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) {
  441. ui.radioStable->setEnabled(false);
  442. }
  443.  
  444. // try to use the old selection first. If no selection has been made
  445. // in the past, use a preselection based on released status.
  446. if(RbSettings::value(RbSettings::Build).toString() == "stable"
  447. - && !RbSettings::value(RbSettings::CurReleaseVersion).toString().isEmpty())
  448. + && !ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty())
  449. ui.radioStable->setChecked(true);
  450. else if(RbSettings::value(RbSettings::Build).toString() == "archived")
  451. ui.radioArchived->setChecked(true);
  452. else if(RbSettings::value(RbSettings::Build).toString() == "current")
  453. ui.radioCurrent->setChecked(true);
  454. - else if(!RbSettings::value(RbSettings::CurReleaseVersion).toString().isEmpty()) {
  455. + else if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) {
  456. ui.radioStable->setChecked(true);
  457. ui.radioStable->setEnabled(true);
  458. QFont font;
  459. @@ -142,26 +143,26 @@
  460. if(ui.radioStable->isChecked()) {
  461. file = RbSettings::value(RbSettings::ReleaseUrl).toString();
  462. RbSettings::setValue(RbSettings::Build, "stable");
  463. - myversion = RbSettings::value(RbSettings::CurReleaseVersion).toString();
  464. + myversion = ServerInfo::value(ServerInfo::CurReleaseVersion).toString();
  465. }
  466. else if(ui.radioArchived->isChecked()) {
  467. file = RbSettings::value(RbSettings::DailyUrl).toString();
  468. RbSettings::setValue(RbSettings::Build, "archived");
  469. - myversion = "r" + RbSettings::value(RbSettings::DailyRevision).toString() + "-" + RbSettings::value(RbSettings::DailyDate).toString();
  470. + myversion = "r" + ServerInfo::value(ServerInfo::DailyRevision).toString() + "-" + ServerInfo::value(ServerInfo::DailyDate).toString();
  471. }
  472. else if(ui.radioCurrent->isChecked()) {
  473. file = RbSettings::value(RbSettings::BleedingUrl).toString();
  474. RbSettings::setValue(RbSettings::Build, "current");
  475. - myversion = "r" + RbSettings::value(RbSettings::BleedingRevision).toString();
  476. + myversion = "r" + ServerInfo::value(ServerInfo::BleedingRevision).toString();
  477. }
  478. else {
  479. qDebug() << "[Install] no build selected -- this shouldn't happen";
  480. return;
  481. }
  482. file.replace("%MODEL%", buildname);
  483. - file.replace("%RELVERSION%", RbSettings::value(RbSettings::CurReleaseVersion).toString());
  484. - file.replace("%REVISION%", RbSettings::value(RbSettings::DailyRevision).toString());
  485. - file.replace("%DATE%", RbSettings::value(RbSettings::DailyDate).toString());
  486. + file.replace("%RELVERSION%", ServerInfo::value(ServerInfo::CurReleaseVersion).toString());
  487. + file.replace("%REVISION%", ServerInfo::value(ServerInfo::DailyRevision).toString());
  488. + file.replace("%DATE%", ServerInfo::value(ServerInfo::DailyDate).toString());
  489.  
  490. RbSettings::sync();
  491.  
  492. @@ -268,8 +269,8 @@
  493. ui.labelDetails->setText(tr("This is the absolute up to the minute "
  494. "Rockbox built. A current build will get updated every time "
  495. "a change is made. Latest version is r%1 (%2).")
  496. - .arg(RbSettings::value(RbSettings::BleedingRevision).toString(),RbSettings::value(RbSettings::BleedingDate).toString()));
  497. - if(RbSettings::value(RbSettings::CurReleaseVersion).toString().isEmpty())
  498. + .arg(ServerInfo::value(ServerInfo::BleedingRevision).toString(),ServerInfo::value(ServerInfo::BleedingDate).toString()));
  499. + if(ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty())
  500. ui.labelNote->setText(tr("<b>This is the recommended version.</b>"));
  501. else
  502. ui.labelNote->setText("");
  503. @@ -283,11 +284,11 @@
  504. ui.labelDetails->setText(
  505. tr("This is the last released version of Rockbox."));
  506.  
  507. - if(!RbSettings::value(RbSettings::CurReleaseVersion).toString().isEmpty())
  508. + if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty())
  509. ui.labelNote->setText(tr("<b>Note:</b> "
  510. "The lastest released version is %1. "
  511. "<b>This is the recommended version.</b>")
  512. - .arg(RbSettings::value(RbSettings::CurReleaseVersion).toString()));
  513. + .arg(ServerInfo::value(ServerInfo::CurReleaseVersion).toString()));
  514. else ui.labelNote->setText("");
  515. }
  516. }
  517. @@ -301,7 +302,7 @@
  518. "features than the last stable release but may be much less stable. "
  519. "Features may change regularly."));
  520. ui.labelNote->setText(tr("<b>Note:</b> archived version is r%1 (%2).")
  521. - .arg(RbSettings::value(RbSettings::DailyRevision).toString(),RbSettings::value(RbSettings::DailyDate).toString()));
  522. + .arg(ServerInfo::value(ServerInfo::DailyRevision).toString(),ServerInfo::value(ServerInfo::DailyDate).toString()));
  523. }
  524. }
  525.  
  526. Index: rbutil/rbutilqt/rbutil.ini
  527. ===================================================================
  528. --- rbutil/rbutilqt/rbutil.ini (revision 24320)
  529. +++ rbutil/rbutilqt/rbutil.ini (working copy)
  530. @@ -301,7 +301,7 @@
  531. bootloadername=/ipod/bootloader-ipodmini1g.ipod
  532. manualname=rockbox-ipodmini2g
  533. brand=Apple
  534. -configure_modelname=ipodmini
  535. +configure_modelname=ipodmini1g
  536. encoder=rbspeex
  537.  
  538. [ipodmini2g]
  539. @@ -358,19 +358,19 @@
  540. manualname=
  541. brand=Cowon
  542. usbid=0x0e210500
  543. -configure_modelname=m3
  544. +configure_modelname=iaudiom3
  545. encoder=rbspeex
  546.  
  547. [gigabeatf]
  548. name="Gigabeat F / X"
  549. -buildserver_modelname=gigabeatf
  550. +buildserver_modelname=gigabeatfx
  551. bootloadermethod=file
  552. bootloadername=/toshiba/gigabeat-fx/FWIMG01.DAT
  553. bootloaderfile=/GBSYSTEM/FWIMG/FWIMG01.DAT
  554. manualname=
  555. brand=Toshiba
  556. usbid=0x09300009
  557. -configure_modelname=gigabeatf
  558. +configure_modelname=gigabeatfx
  559. encoder=rbspeex
  560.  
  561. [sansae200]
  562. @@ -437,7 +437,7 @@
  563. status=disabled
  564.  
  565. [sansaclip]
  566. -name="Sansa Clip (Unstable)"
  567. +name="Sansa Clip"
  568. buildserver_modelname=sansaclip
  569. bootloadermethod=ams
  570. bootloadername=/sandisk-sansa/clip/bootloader-clip.sansa
  571. @@ -501,43 +501,43 @@
  572. status=disabled
  573.  
  574. [smsgyh820]
  575. -name="YH-820 (Unstable)"
  576. -buildserver_modelname=yh820
  577. +name="YH-820"
  578. +buildserver_modelname=samsungyh820
  579. bootloadermethod=mi4
  580. bootloadername=/samsung/yh820/FW_YH820.mi4
  581. bootloaderfile=/SYSTEM/FW_YH820.mi4
  582. manualname=
  583. brand=Samsung
  584. usbid=0x04e85023
  585. -configure_modelname=yh820
  586. +configure_modelname=samsungyh820
  587. encoder=rbspeex
  588.  
  589. [smsgyh920]
  590. -name="YH-920 (Unstable)"
  591. -buildserver_modelname=yh920
  592. +name="YH-920"
  593. +buildserver_modelname=samsungyh920
  594. bootloadermethod=mi4
  595. bootloadername=/samsung/yh920/PP5020.mi4
  596. bootloaderfile=/SYSTEM/FW_YH920.mi4, /SYSTEM/PP5020.mi4
  597. manualname=
  598. brand=Samsung
  599. usbid=0x04e85022, 0x04e8501d
  600. -configure_modelname=yh920
  601. +configure_modelname=samsungyh920
  602. encoder=rbspeex
  603.  
  604. [smsgyh925]
  605. -name="YH-925 (Unstable)"
  606. -buildserver_modelname=yh925
  607. +name="YH-925"
  608. +buildserver_modelname=samsungyh925
  609. bootloadermethod=mi4
  610. bootloadername=/samsung/yh925/FW_YH925.mi4
  611. bootloaderfile=/SYSTEM/FW_YH925.mi4
  612. manualname=
  613. brand=Samsung
  614. usbid=0x04e85024
  615. -configure_modelname=yh925
  616. +configure_modelname=samsungyh925
  617. encoder=rbspeex
  618.  
  619. [cowond2]
  620. -name="D2 (Unstable)"
  621. +name="D2"
  622. buildserver_modelname=cowond2
  623. bootloadermethod=tcc
  624. bootloadername=/cowon/d2/bootloader-cowond2.bin
  625. Index: rbutil/rbutilqt/rbutilqt.cpp
  626. ===================================================================
  627. --- rbutil/rbutilqt/rbutilqt.cpp (revision 24320)
  628. +++ rbutil/rbutilqt/rbutilqt.cpp (working copy)
  629. @@ -36,6 +36,7 @@
  630. #include "system.h"
  631. #include "systrace.h"
  632. #include "rbsettings.h"
  633. +#include "serverinfo.h"
  634.  
  635. #include "progressloggerinterface.h"
  636.  
  637. @@ -194,30 +195,10 @@
  638. }
  639. qDebug() << "[RbUtil] network status:" << daily->error();
  640.  
  641. - // read info into settings object
  642. + // read info into ServerInfo object
  643. buildInfo.open();
  644. - QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
  645. + ServerInfo::readBuildInfo(buildInfo.fileName());
  646. buildInfo.close();
  647. - RbSettings::setValue(RbSettings::DailyRevision,info.value("dailies/rev"));
  648. - QDate date = QDate::fromString(info.value("dailies/date").toString(), "yyyyMMdd");
  649. - RbSettings::setValue(RbSettings::DailyDate,date.toString());
  650. -
  651. - info.beginGroup("release");
  652. - QStringList keys = info.allKeys();
  653. - for(int i=0; i < keys.size(); i++)
  654. - {
  655. - RbSettings::setPlatformValue(keys[i],RbSettings::CurReleaseVersion,info.value(keys[i]));
  656. - }
  657. - info.endGroup();
  658. -
  659. - info.beginGroup("status");
  660. - keys = info.allKeys();
  661. - for(int i=0; i < keys.size(); i++)
  662. - {
  663. - RbSettings::setPlatformValue(keys[i],RbSettings::CurStatus,info.value(keys[i]));
  664. - }
  665. - info.endGroup();
  666. -
  667.  
  668. //start bleeding info download
  669. bleeding = new HttpGet(this);
  670. @@ -240,12 +221,9 @@
  671. }
  672. else {
  673. bleedingInfo.open();
  674. - QSettings info(bleedingInfo.fileName(), QSettings::IniFormat, this);
  675. + ServerInfo::readBleedingInfo(bleedingInfo.fileName());
  676. bleedingInfo.close();
  677. - RbSettings::setValue(RbSettings::BleedingRevision,info.value("bleeding/rev"));
  678. - QDateTime date = QDateTime::fromString(info.value("bleeding/timestamp").toString(), "yyyyMMddThhmmssZ");
  679. - RbSettings::setValue(RbSettings::BleedingDate,date.toString());
  680. -
  681. +
  682. ui.statusbar->showMessage(tr("Download build information finished."), 5000);
  683. updateSettings();
  684. m_gotInfo = true;
  685. @@ -376,14 +354,15 @@
  686. // displayed device info
  687. QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
  688. QString brand = RbSettings::value(RbSettings::CurBrand).toString();
  689. - QString name = RbSettings::value(RbSettings::CurName).toString();
  690. + QString name = RbSettings::value(RbSettings::CurName).toString() +
  691. + " (" + ServerInfo::value(ServerInfo::CurStatus).toString() + ")";
  692. if(name.isEmpty()) name = "&lt;none&gt;";
  693. if(mountpoint.isEmpty()) mountpoint = "&lt;invalid&gt;";
  694. ui.labelDevice->setText(tr("<b>%1 %2</b> at <b>%3</b>")
  695. .arg(brand, name, QDir::toNativeSeparators(mountpoint)));
  696.  
  697. // hide quickstart buttons if no release available
  698. - bool installable = !RbSettings::value(RbSettings::CurReleaseVersion).toString().isEmpty();
  699. + bool installable = !ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty();
  700. ui.buttonSmall->setEnabled(installable);
  701. ui.buttonComplete->setEnabled(installable);
  702. ui.actionSmall_Installation->setEnabled(installable);
  703. @@ -426,7 +405,7 @@
  704. "This will install Rockbox %1. To install the most recent "
  705. "development build available press \"Cancel\" and "
  706. "use the \"Installation\" tab.")
  707. - .arg(RbSettings::value(RbSettings::CurReleaseVersion).toString()),
  708. + .arg(ServerInfo::value(ServerInfo::CurReleaseVersion).toString()),
  709. QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok)
  710. return;
  711. // create logger
  712. @@ -484,7 +463,7 @@
  713. "This will install Rockbox %1. To install the most recent "
  714. "development build available press \"Cancel\" and "
  715. "use the \"Installation\" tab.")
  716. - .arg(RbSettings::value(RbSettings::CurReleaseVersion).toString()),
  717. + .arg(ServerInfo::value(ServerInfo::CurReleaseVersion).toString()),
  718. QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok)
  719. return;
  720.  
  721. @@ -558,7 +537,7 @@
  722. {
  723. QString file = RbSettings::value(RbSettings::ReleaseUrl).toString();
  724. file.replace("%MODEL%", RbSettings::value(RbSettings::CurBuildserverModel).toString());
  725. - file.replace("%RELVERSION%", RbSettings::value(RbSettings::CurReleaseVersion).toString());
  726. + file.replace("%RELVERSION%", ServerInfo::value(ServerInfo::CurReleaseVersion).toString());
  727.  
  728. // check installed Version and Target
  729. QString warning = check(false);
  730. @@ -615,7 +594,7 @@
  731. ZipInstaller* installer = new ZipInstaller(this);
  732. installer->setUrl(file);
  733. installer->setLogSection("Rockbox (Base)");
  734. - installer->setLogVersion(RbSettings::value(RbSettings::CurReleaseVersion).toString());
  735. + installer->setLogVersion(ServerInfo::value(ServerInfo::CurReleaseVersion).toString());
  736. if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
  737. installer->setCache(true);
  738. installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
  739. @@ -849,7 +828,7 @@
  740.  
  741. installer->setUrl(RbSettings::value(RbSettings::FontUrl).toString());
  742. installer->setLogSection("Fonts");
  743. - installer->setLogVersion(RbSettings::value(RbSettings::DailyDate).toString());
  744. + installer->setLogVersion(ServerInfo::value(ServerInfo::DailyDate).toString());
  745. installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
  746. if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
  747. installer->setCache(true);
  748. @@ -888,12 +867,12 @@
  749. QString voiceurl = RbSettings::value(RbSettings::VoiceUrl).toString();
  750.  
  751. voiceurl += RbSettings::value(RbSettings::CurBuildserverModel).toString() + "-" +
  752. - RbSettings::value(RbSettings::DailyDate).toString() + "-english.zip";
  753. + ServerInfo::value(ServerInfo::DailyDate).toString() + "-english.zip";
  754. qDebug() << "[RbUtil] voicefile URL:" << voiceurl;
  755.  
  756. installer->setUrl(voiceurl);
  757. installer->setLogSection("Voice");
  758. - installer->setLogVersion(RbSettings::value(RbSettings::DailyDate).toString());
  759. + installer->setLogVersion(ServerInfo::value(ServerInfo::DailyDate).toString());
  760. installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
  761. if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
  762. installer->setCache(true);
  763. @@ -943,7 +922,7 @@
  764.  
  765. installer->setUrl(RbSettings::value(RbSettings::DoomUrl).toString());
  766. installer->setLogSection("Game Addons");
  767. - installer->setLogVersion(RbSettings::value(RbSettings::DailyDate).toString());
  768. + installer->setLogVersion(ServerInfo::value(ServerInfo::DailyDate).toString());
  769. installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
  770. if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
  771. installer->setCache(true);
  772. @@ -968,8 +947,6 @@
  773. {
  774. if(chkConfig(true)) return;
  775. InstallTalkWindow *installWindow = new InstallTalkWindow(this);
  776. -
  777. - connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo()));
  778. connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
  779. installWindow->show();
  780.  
  781. @@ -980,7 +957,6 @@
  782. if(chkConfig(true)) return;
  783. CreateVoiceWindow *installWindow = new CreateVoiceWindow(this);
  784.  
  785. - connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo()));
  786. connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
  787. installWindow->show();
  788. }
  789. @@ -1062,7 +1038,7 @@
  790. if(manual.isEmpty())
  791. manual = "rockbox-" + RbSettings::value(RbSettings::Platform).toString();
  792.  
  793. - QString date = RbSettings::value(RbSettings::DailyDate).toString();
  794. + QString date = ServerInfo::value(ServerInfo::DailyDate).toString();
  795.  
  796. QString manualurl;
  797. QString target;
  798. Index: rbutil/rbutilqt/rbutilqt.pro
  799. ===================================================================
  800. --- rbutil/rbutilqt/rbutilqt.pro (revision 24320)
  801. +++ rbutil/rbutilqt/rbutilqt.pro (working copy)
  802. @@ -97,6 +97,7 @@
  803. base/voicefile.cpp \
  804. createvoicewindow.cpp \
  805. base/rbsettings.cpp \
  806. + base/serverinfo.cpp \
  807. base/rbunzip.cpp \
  808. base/rbzip.cpp \
  809. base/system.cpp \
  810. @@ -158,6 +159,7 @@
  811. base/voicefile.h \
  812. createvoicewindow.h \
  813. base/rbsettings.h \
  814. + base/serverinfo.h \
  815. base/rbunzip.h \
  816. base/rbzip.h \
  817. sysinfo.h \
  818.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement