diff options
-rw-r--r-- | rbutil/rbutilqt/base/serverinfo.cpp | 15 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/serverinfo.h | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/rbutil/rbutilqt/base/serverinfo.cpp b/rbutil/rbutilqt/base/serverinfo.cpp index 995cc1fe74..fd46f13a8b 100644 --- a/rbutil/rbutilqt/base/serverinfo.cpp +++ b/rbutil/rbutilqt/base/serverinfo.cpp | |||
@@ -56,7 +56,10 @@ void ServerInfo::readBuildInfo(QString file) | |||
56 | setValue(ServerInfo::BleedingDate, date.toString(Qt::ISODate)); | 56 | setValue(ServerInfo::BleedingDate, date.toString(Qt::ISODate)); |
57 | 57 | ||
58 | info.beginGroup("release"); | 58 | info.beginGroup("release"); |
59 | QStringList keys = info.allKeys(); | 59 | QStringList releasekeys = info.allKeys(); |
60 | info.endGroup(); | ||
61 | info.beginGroup("release-candidate"); | ||
62 | QStringList rckeys = info.allKeys(); | ||
60 | info.endGroup(); | 63 | info.endGroup(); |
61 | 64 | ||
62 | // get base platforms, handle variants with platforms in the loop | 65 | // get base platforms, handle variants with platforms in the loop |
@@ -75,13 +78,13 @@ void ServerInfo::readBuildInfo(QString file) | |||
75 | // - <target>=<version>. In this case the URL is constructed. | 78 | // - <target>=<version>. In this case the URL is constructed. |
76 | // - <target>=<version>,<url>. | 79 | // - <target>=<version>,<url>. |
77 | info.beginGroup("release"); | 80 | info.beginGroup("release"); |
78 | if(keys.contains(platforms.at(i))) { | 81 | if(releasekeys.contains(platforms.at(i))) { |
79 | QStringList entry = info.value(platforms.at(i)).toStringList(); | 82 | QStringList entry = info.value(platforms.at(i)).toStringList(); |
80 | releaseVersion = entry.at(0); | 83 | releaseVersion = entry.at(0); |
81 | if(entry.size() > 1) { | 84 | if(entry.size() > 1) { |
82 | releaseUrl = entry.at(1); | 85 | releaseUrl = entry.at(1); |
83 | } | 86 | } |
84 | else { | 87 | else if(!releaseVersion.isEmpty()) { |
85 | // construct release download URL | 88 | // construct release download URL |
86 | releaseUrl = releaseBaseUrl; | 89 | releaseUrl = releaseBaseUrl; |
87 | releaseUrl.replace("%MODEL%", platforms.at(i)); | 90 | releaseUrl.replace("%MODEL%", platforms.at(i)); |
@@ -91,10 +94,10 @@ void ServerInfo::readBuildInfo(QString file) | |||
91 | info.endGroup(); | 94 | info.endGroup(); |
92 | // "release-candidate" section currently only support the 2nd format. | 95 | // "release-candidate" section currently only support the 2nd format. |
93 | info.beginGroup("release-candidate"); | 96 | info.beginGroup("release-candidate"); |
94 | if(keys.contains(platforms.at(i))) { | 97 | if(rckeys.contains(platforms.at(i))) { |
95 | QStringList entry = info.value(platforms.at(i)).toStringList(); | 98 | QStringList entry = info.value(platforms.at(i)).toStringList(); |
96 | relCandidateVersion = entry.at(0); | ||
97 | if(entry.size() > 1) { | 99 | if(entry.size() > 1) { |
100 | relCandidateVersion = entry.at(0); | ||
98 | relCandidateUrl = entry.at(1); | 101 | relCandidateUrl = entry.at(1); |
99 | } | 102 | } |
100 | } | 103 | } |
@@ -183,7 +186,7 @@ QVariant ServerInfo::platformValue(QString platform, enum ServerInfos info) | |||
183 | s.replace(":platform:", platform); | 186 | s.replace(":platform:", platform); |
184 | QString d = ServerInfoList[i].def; | 187 | QString d = ServerInfoList[i].def; |
185 | d.replace(":platform:", platform); | 188 | d.replace(":platform:", platform); |
186 | qDebug() << "[ServerInfo] GET" << s << serverInfos.value(s, d).toString(); | 189 | qDebug() << "[ServerInfo] GET:" << s << serverInfos.value(s, d).toString(); |
187 | return serverInfos.value(s, d); | 190 | return serverInfos.value(s, d); |
188 | } | 191 | } |
189 | 192 | ||
diff --git a/rbutil/rbutilqt/base/serverinfo.h b/rbutil/rbutilqt/base/serverinfo.h index 7021c3f154..ea68fd7fc4 100644 --- a/rbutil/rbutilqt/base/serverinfo.h +++ b/rbutil/rbutilqt/base/serverinfo.h | |||
@@ -49,7 +49,7 @@ class ServerInfo : public QObject | |||
49 | 49 | ||
50 | private: | 50 | private: |
51 | //! set a server info value | 51 | //! set a server info value |
52 | static void setValue(enum ServerInfos setting , QVariant value); | 52 | static void setValue(enum ServerInfos setting, QVariant value); |
53 | //! set a value for a server info for a named platform. | 53 | //! set a value for a server info for a named platform. |
54 | static void setPlatformValue(QString platform, enum ServerInfos setting, QVariant value); | 54 | static void setPlatformValue(QString platform, enum ServerInfos setting, QVariant value); |
55 | //! you shouldnt call this, its a fully static class | 55 | //! you shouldnt call this, its a fully static class |