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
This commit is contained in:
Dominik Riebeling 2012-06-03 00:50:01 +02:00
parent b73c961683
commit f4b0e316c3
9 changed files with 21 additions and 71 deletions

View file

@ -32,20 +32,20 @@ const static struct {
} ServerInfoList[] = {
{ ServerInfo::CurReleaseVersion, ":platform:/releaseversion", "" },
{ ServerInfo::CurStatus, ":platform:/status", "Unknown" },
{ ServerInfo::DailyDate, "dailydate", "" },
{ ServerInfo::BleedingRevision, "bleedingrev", "" },
{ ServerInfo::BleedingDate, "bleedingdate", "" },
};
};
QMap<QString, QVariant> ServerInfo::serverInfos;
void ServerInfo::readBuildInfo(QString file)
{
QSettings info(file, QSettings::IniFormat);
QDate date = QDate::fromString(info.value("dailies/date").toString(), "yyyyMMdd");
setValue(ServerInfo::DailyDate,date.toString(Qt::ISODate));
setValue(ServerInfo::BleedingRevision,info.value("bleeding/rev"));
QDateTime date = QDateTime::fromString(info.value("bleeding/timestamp").toString(), "yyyyMMddThhmmssZ");
setValue(ServerInfo::BleedingDate,date.toString(Qt::ISODate));
info.beginGroup("release");
QStringList keys = info.allKeys();
info.endGroup();
@ -87,19 +87,10 @@ void ServerInfo::readBuildInfo(QString file)
setPlatformValue(variants.at(j), ServerInfo::CurStatus, status);
setPlatformValue(variants.at(j), ServerInfo::CurReleaseVersion, release);
}
}
}
void ServerInfo::readBleedingInfo(QString file)
{
QSettings info(file, QSettings::IniFormat);
setValue(ServerInfo::BleedingRevision,info.value("bleeding/rev"));
QDateTime date = QDateTime::fromString(info.value("bleeding/timestamp").toString(), "yyyyMMddThhmmssZ");
setValue(ServerInfo::BleedingDate,date.toString(Qt::ISODate));
}
QVariant ServerInfo::value(enum ServerInfos info)
{
// locate info item

View file

@ -27,25 +27,22 @@ class ServerInfo : public QObject
{
Q_OBJECT
public:
//! All Server infos
enum ServerInfos {
CurReleaseVersion,
CurStatus,
DailyDate,
BleedingRevision,
BleedingDate,
};
//! read in buildinfo file
static void readBuildInfo(QString file);
//! read in bleeding info file
static void readBleedingInfo(QString file);
//! get a value from server info
static QVariant value(enum ServerInfos setting);
//! get a value from server info for a named platform.
static QVariant platformValue(QString platform, enum ServerInfos setting);
private:
//! set a server info value
static void setValue(enum ServerInfos setting , QVariant value);

View file

@ -43,12 +43,11 @@ const static struct {
{ SystemInfo::DoomUrl, "doom_url", "" },
{ SystemInfo::ReleaseUrl, "release_url", "" },
{ SystemInfo::DailyUrl, "daily_url", "" },
{ SystemInfo::ServerConfUrl, "server_conf_url", "" },
{ SystemInfo::BuildInfoUrl, "build_info_url", "" },
{ SystemInfo::GenlangUrl, "genlang_url", "" },
{ SystemInfo::ThemesUrl, "themes_url", "" },
{ SystemInfo::ThemesInfoUrl, "themes_info_url", "" },
{ SystemInfo::RbutilUrl, "rbutil_url", "" },
{ SystemInfo::BleedingInfo, "bleeding_info", "" },
{ SystemInfo::CurPlatformName, ":platform:/name", "" },
{ SystemInfo::CurManual, ":platform:/manualname","rockbox-:platform:" },
{ SystemInfo::CurBootloaderMethod, ":platform:/bootloadermethod", "none" },

View file

@ -47,12 +47,11 @@ class SystemInfo : public QObject
ReleaseUrl,
ReleaseVoiceUrl,
ReleaseFontUrl,
ServerConfUrl,
BuildInfoUrl,
GenlangUrl,
ThemesUrl,
ThemesInfoUrl,
RbutilUrl,
BleedingInfo,
CurPlatformName,
CurManual,
CurBootloaderMethod,