From 4c9fc9cb7ed9cb9c0163f81acce5b71ae2dcb29d Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Fri, 12 Feb 2010 20:38:17 +0000 Subject: 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 --- rbutil/rbutilqt/base/systeminfo.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'rbutil/rbutilqt/base/systeminfo.cpp') 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; } -- cgit v1.2.3