summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-02-12 20:38:17 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-02-12 20:38:17 +0000
commit4c9fc9cb7ed9cb9c0163f81acce5b71ae2dcb29d (patch)
tree72aadddd80a8e689072be8075cf74d8360353632
parent9a256c96f7fcb60d94bb0c58f499e2f43ce9957a (diff)
downloadrockbox-4c9fc9cb7ed9cb9c0163f81acce5b71ae2dcb29d.tar.gz
rockbox-4c9fc9cb7ed9cb9c0163f81acce5b71ae2dcb29d.tar.bz2
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
-rw-r--r--rbutil/rbutilqt/base/serverinfo.cpp4
-rw-r--r--rbutil/rbutilqt/base/systeminfo.cpp23
-rw-r--r--rbutil/rbutilqt/base/systeminfo.h4
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)
info.endGroup();
// get base platforms, handle variants with platforms in the loop
- QStringList platforms = SystemInfo::platforms(SystemInfo::PlatformBase);
+ QStringList platforms = SystemInfo::platforms(SystemInfo::PlatformBaseDisabled);
for(int i = 0; i < platforms.size(); i++)
{
// check if there are rbutil-variants of the current platform and handle
// them the same time.
QStringList variants;
- variants = SystemInfo::platforms(SystemInfo::PlatformVariant, platforms.at(i));
+ variants = SystemInfo::platforms(SystemInfo::PlatformVariantDisabled, platforms.at(i));
QVariant release;
info.beginGroup("release");
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
for(int i = 0; i < a.size(); i++)
{
QString target = systemInfos->value("platforms/"+a.at(i), "null").toString();
- // only add target if its not disabled
- if(type != PlatformAllDisabled
+ QRegExp regex("\\..*$");
+ QString targetbase = target;
+ targetbase.remove(regex);
+ // only add target if its not disabled unless Platform*Disabled requested
+ if(type != PlatformAllDisabled && type != PlatformBaseDisabled
+ && type != PlatformVariantDisabled
&& systemInfos->value(target+"/status").toString() == "disabled")
continue;
- // report only base targets when PlatformBase is requested
- if(type == PlatformBase && target.contains('.'))
+ // report only matching target if PlatformVariant* is requested
+ if((type == PlatformVariant || type == PlatformVariantDisabled)
+ && (targetbase != variant))
continue;
- // report only matching target if PlatformVariant is requested
- if(type == PlatformVariant && !target.startsWith(variant))
- continue;
- result.append(target);
+ // report only base targets when PlatformBase* is requested
+ if((type == PlatformBase || type == PlatformBaseDisabled))
+ result.append(targetbase);
+ else
+ result.append(target);
}
+ result.removeDuplicates();
return result;
}
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
PlatformAll,
PlatformAllDisabled,
PlatformBase,
- PlatformVariant
+ PlatformBaseDisabled,
+ PlatformVariant,
+ PlatformVariantDisabled
};
//! return a list of all platforms (rbutil internal names)