diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2010-02-12 20:38:17 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2010-02-12 20:38:17 +0000 |
commit | 4c9fc9cb7ed9cb9c0163f81acce5b71ae2dcb29d (patch) | |
tree | 72aadddd80a8e689072be8075cf74d8360353632 /rbutil | |
parent | 9a256c96f7fcb60d94bb0c58f499e2f43ce9957a (diff) | |
download | rockbox-4c9fc9cb7ed9cb9c0163f81acce5b71ae2dcb29d.tar.gz rockbox-4c9fc9cb7ed9cb9c0163f81acce5b71ae2dcb29d.zip |
Fix problems with platform retrieval.
- handle disabled platforms also for for variant and base groups.
- make variant detection more strict to prevent variants that are a substring
of other variants to match. Happened e.g. for iriverh10 and iriverh100.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24625 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/rbutilqt/base/serverinfo.cpp | 4 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/systeminfo.cpp | 23 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/systeminfo.h | 4 |
3 files changed, 20 insertions, 11 deletions
diff --git a/rbutil/rbutilqt/base/serverinfo.cpp b/rbutil/rbutilqt/base/serverinfo.cpp index e581e952ac..0151273338 100644 --- a/rbutil/rbutilqt/base/serverinfo.cpp +++ b/rbutil/rbutilqt/base/serverinfo.cpp | |||
@@ -54,13 +54,13 @@ void ServerInfo::readBuildInfo(QString file) | |||
54 | info.endGroup(); | 54 | info.endGroup(); |
55 | 55 | ||
56 | // get base platforms, handle variants with platforms in the loop | 56 | // get base platforms, handle variants with platforms in the loop |
57 | QStringList platforms = SystemInfo::platforms(SystemInfo::PlatformBase); | 57 | QStringList platforms = SystemInfo::platforms(SystemInfo::PlatformBaseDisabled); |
58 | for(int i = 0; i < platforms.size(); i++) | 58 | for(int i = 0; i < platforms.size(); i++) |
59 | { | 59 | { |
60 | // check if there are rbutil-variants of the current platform and handle | 60 | // check if there are rbutil-variants of the current platform and handle |
61 | // them the same time. | 61 | // them the same time. |
62 | QStringList variants; | 62 | QStringList variants; |
63 | variants = SystemInfo::platforms(SystemInfo::PlatformVariant, platforms.at(i)); | 63 | variants = SystemInfo::platforms(SystemInfo::PlatformVariantDisabled, platforms.at(i)); |
64 | QVariant release; | 64 | QVariant release; |
65 | info.beginGroup("release"); | 65 | info.beginGroup("release"); |
66 | if(keys.contains(platforms.at(i))) { | 66 | if(keys.contains(platforms.at(i))) { |
diff --git a/rbutil/rbutilqt/base/systeminfo.cpp b/rbutil/rbutilqt/base/systeminfo.cpp index d5de5fff2a..a941f43078 100644 --- a/rbutil/rbutilqt/base/systeminfo.cpp +++ b/rbutil/rbutilqt/base/systeminfo.cpp | |||
@@ -118,18 +118,25 @@ QStringList SystemInfo::platforms(enum SystemInfo::PlatformType type, QString va | |||
118 | for(int i = 0; i < a.size(); i++) | 118 | for(int i = 0; i < a.size(); i++) |
119 | { | 119 | { |
120 | QString target = systemInfos->value("platforms/"+a.at(i), "null").toString(); | 120 | QString target = systemInfos->value("platforms/"+a.at(i), "null").toString(); |
121 | // only add target if its not disabled | 121 | QRegExp regex("\\..*$"); |
122 | if(type != PlatformAllDisabled | 122 | QString targetbase = target; |
123 | targetbase.remove(regex); | ||
124 | // only add target if its not disabled unless Platform*Disabled requested | ||
125 | if(type != PlatformAllDisabled && type != PlatformBaseDisabled | ||
126 | && type != PlatformVariantDisabled | ||
123 | && systemInfos->value(target+"/status").toString() == "disabled") | 127 | && systemInfos->value(target+"/status").toString() == "disabled") |
124 | continue; | 128 | continue; |
125 | // report only base targets when PlatformBase is requested | 129 | // report only matching target if PlatformVariant* is requested |
126 | if(type == PlatformBase && target.contains('.')) | 130 | if((type == PlatformVariant || type == PlatformVariantDisabled) |
131 | && (targetbase != variant)) | ||
127 | continue; | 132 | continue; |
128 | // report only matching target if PlatformVariant is requested | 133 | // report only base targets when PlatformBase* is requested |
129 | if(type == PlatformVariant && !target.startsWith(variant)) | 134 | if((type == PlatformBase || type == PlatformBaseDisabled)) |
130 | continue; | 135 | result.append(targetbase); |
131 | result.append(target); | 136 | else |
137 | result.append(target); | ||
132 | } | 138 | } |
139 | result.removeDuplicates(); | ||
133 | return result; | 140 | return result; |
134 | } | 141 | } |
135 | 142 | ||
diff --git a/rbutil/rbutilqt/base/systeminfo.h b/rbutil/rbutilqt/base/systeminfo.h index bab4815421..76d00d4949 100644 --- a/rbutil/rbutilqt/base/systeminfo.h +++ b/rbutil/rbutilqt/base/systeminfo.h | |||
@@ -67,7 +67,9 @@ class SystemInfo : public QObject | |||
67 | PlatformAll, | 67 | PlatformAll, |
68 | PlatformAllDisabled, | 68 | PlatformAllDisabled, |
69 | PlatformBase, | 69 | PlatformBase, |
70 | PlatformVariant | 70 | PlatformBaseDisabled, |
71 | PlatformVariant, | ||
72 | PlatformVariantDisabled | ||
71 | }; | 73 | }; |
72 | 74 | ||
73 | //! return a list of all platforms (rbutil internal names) | 75 | //! return a list of all platforms (rbutil internal names) |