# HG changeset patch # User timkelly # Date 1279750341 18000 # Node ID 65c3d72a8793909eba05fabd4c713427e688dbd9 # Parent 21ded3449e77564b737df9d395c2ca8b47c2ce18 fix some config refresh issues with SDK/Config tree management. Fixed some issues with showing proper configs re: SBSv2 config filtering prefs. diff -r 21ded3449e77 -r 65c3d72a8793 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/ManageConfigurationsDialog.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/ManageConfigurationsDialog.java Wed Jul 21 16:13:43 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/ManageConfigurationsDialog.java Wed Jul 21 17:12:21 2010 -0500 @@ -359,7 +359,7 @@ @Override public String toString() { ISymbianBuildContext context = (ISymbianBuildContext)getValue(); - return context.getDisplayString(); + return stripSDKIDFromConfigName(context.getDisplayString(), context.getSDK().getUniqueId()); } }; } @@ -371,7 +371,7 @@ @Override public String toString() { ISymbianBuildContext context = (ISymbianBuildContext)getValue(); - return context.getDisplayString(); + return stripSDKIDFromConfigName(context.getDisplayString(), context.getSDK().getUniqueId()); } }; } @@ -526,5 +526,10 @@ // now apply any changes cpm.saveChanges(); } + + private static String stripSDKIDFromConfigName(String configName, String sdkID){ + return configName.replace("[" + sdkID + "]", ""); + } + } diff -r 21ded3449e77 -r 65c3d72a8793 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java Wed Jul 21 16:13:43 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java Wed Jul 21 17:12:21 2010 -0500 @@ -139,6 +139,9 @@ contextExists = false; } + // Get the list of configs that have already been queried. If they have not been queried + // we'll save them off in a list to run an actual query. + // TODO: If a config has an error condition should we try to scan it again? List processedAliasList = new ArrayList(); for (String alias : newContextsToQuery) { SBSv2ConfigQueryData configQueryData = SBSv2QueryUtils.getConfigQueryDataForSDK(sdk, alias); @@ -150,12 +153,13 @@ } if (!processedAliasList.isEmpty()) { - newContextsToQuery.removeAll(processedAliasList); + newContextsToQuery.removeAll(processedAliasList); // No need to qeury anything } + // Query any contextst that don't have configQueryData and add them to the filtered list + // We do this separately b/c it can be a slow operation so we don't want to do it often if (!newContextsToQuery.isEmpty()) { String configQueryXML = SBSv2QueryUtils.getConfigQueryXMLforSDK(sdk, newContextsToQuery); - for (String alias : newContextsToQuery){ // TODO: Need to test for variants. Right now variants are not added if (aliasToMeaningMap.get(alias) == null){ @@ -166,6 +170,21 @@ sbsv2FilteredConetxts.add(sbsv2Context); } } + + // Now remove any contexts that don't fit + List contextListCopy = new ArrayList(sbsv2FilteredConetxts); + for (ISymbianBuildContext currentContext : contextListCopy){ + boolean match = false; + for (String allowedAlias : allowedConfigs){ + if (allowedAlias.equals(((ISBSv2BuildContext)currentContext).getSBSv2Alias())){ + match = true; + break; + } + } + if (!match) + sbsv2FilteredConetxts.remove(currentContext); + } + } private void initSBSv2BuildContextList(List allowedConfigs) throws SBSv2MinimumVersionException { diff -r 21ded3449e77 -r 65c3d72a8793 core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetTreeNode.java --- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetTreeNode.java Wed Jul 21 16:13:43 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetTreeNode.java Wed Jul 21 17:12:21 2010 -0500 @@ -72,7 +72,7 @@ public String toString() { ISymbianBuildContext context = (ISymbianBuildContext)getValue(); String sdkId = context.getSDK().getUniqueId(); - String newDisplayString = context.getDisplayString().replace("[" + sdkId + "]", ""); + String newDisplayString = stripSDKIDFromConfigName(context.getDisplayString(), sdkId); if (context instanceof ISBSv2BuildContext){ ISBSv2BuildContext v2Context = (ISBSv2BuildContext)context; if (v2Context.getConfigQueryData().getConfigurationErrorMessage() != null && @@ -167,5 +167,10 @@ } return realInput; } + + private static String stripSDKIDFromConfigName(String configName, String sdkID){ + return configName.replace("[" + sdkID + "]", ""); + } + }