Fix some problems displaying broken configs and broken SDKs in the SDK/Config Tree for SBSv2
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Wed Jun 16 12:09:43 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Wed Jun 16 13:27:31 2010 -0500
@@ -64,7 +64,12 @@
this.configID = ISBSv2BuildContext.BUILDER_ID + "." + sbsv2Alias + "." + sdk.getUniqueId();
parseQueryConfigResults(contextQueryXML);
- this.displayString = getPlatformString().toUpperCase() + " " + getTargetString().toUpperCase();
+ if (configParseErrorMessage != null && configParseErrorMessage.length() > 0){
+ this.displayString = sbsv2Alias + " ERROR: " + configParseErrorMessage;
+ } else {
+ this.displayString = getPlatformString().toUpperCase() + " " + getTargetString().toUpperCase();
+ }
+
}
@Override
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SBSv2Utils.java Wed Jun 16 12:09:43 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SBSv2Utils.java Wed Jun 16 13:27:31 2010 -0500
@@ -13,39 +13,24 @@
package com.nokia.carbide.cpp.internal.api.sdk;
import java.io.File;
-import java.io.FileFilter;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
-import java.util.Map;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import org.eclipse.cdt.utils.spawner.EnvironmentReader;
-import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.osgi.framework.Version;
import org.osgi.service.prefs.BackingStoreException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.helpers.DefaultHandler;
-import com.nokia.carbide.cpp.sdk.core.ISBSv2BuildContext;
import com.nokia.carbide.cpp.sdk.core.ISDKManager;
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
-import com.nokia.cpp.internal.api.utils.core.FileUtils;
import com.nokia.cpp.internal.api.utils.core.HostOS;
import com.nokia.cpp.internal.api.utils.core.Logging;
@@ -88,50 +73,6 @@
}
/**
- * Get the build configurations supported by SBSv2
- * @param refreshList whether or not to parse the configuration xml files again
- * @return A map of raptor aliases (key) to base build platform. Never null;
- */
-// public static Map<String, String> getUnfilteredSBSv2BuildConfigurations(boolean refreshList) {
-//
-// if (unfilteredSBSv2ConfigNames == null || refreshList || unfilteredSBSv2ConfigNames.size() == 0) {
-// unfilteredSBSv2ConfigNames = new HashMap<String, String>();
-//
-// // parse the xml files in <sbs-install>/lib/config/ to get SBSv2 configs
-// try {
-//
-// IPath configPath = getSBSBinDirectory();
-// if (configPath != null) {
-// configPath = configPath.removeLastSegments(1).append("lib/config"); //$NON-NLS-1$
-// File configDir = configPath.toFile();
-// if (configDir.exists() && configDir.isDirectory()) {
-// File[] configFiles = FileUtils.listFilesInTree(configDir, new FileFilter() {
-//
-// public boolean accept(File arg0) {
-// if (arg0.isDirectory()) {
-// return true;
-// }
-// return arg0.getName().toLowerCase().endsWith("xml"); //$NON-NLS-1$
-// }
-//
-// }, false);
-//
-// for (File file : configFiles) {
-// getConfigsForFile(file);
-// }
-// }
-// }
-//
-// } catch (Exception e) {
-// e.printStackTrace();
-// Logging.log(SDKCorePlugin.getDefault(), Logging.newStatus(SDKCorePlugin.getDefault(), e));
-// }
-// }
-//
-// return unfilteredSBSv2ConfigNames;
-// }
-
- /**
* Given a list of SDKs, returns the list of the SDK's supported by SBSv2
* @param sdks list of SDK's to check
* @return list of SBSv2 supported SDK's, may be empty
@@ -160,7 +101,7 @@
* Returns the list of SBSv2 build configuration names that should
* INCLUDED in any UI. Only configs to be displayed are saved
*/
- public static List<String> getSBSv2FilteredConfigs() {
+ public static List<String> getSBSv2FilteredConfigPreferences() {
List<String> buildAliasList = new ArrayList<String>();
IEclipsePreferences prefs = new InstanceScope().getNode(SDKCorePlugin.PLUGIN_ID);
if (prefs != null) {
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/SBSv2QueryUtils.java Wed Jun 16 12:09:43 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/SBSv2QueryUtils.java Wed Jun 16 13:27:31 2010 -0500
@@ -318,7 +318,7 @@
HashMap<String, String> sbsAliasMap = parseQueryAliasResult(queryResult);
- List<String> aliasFilterList = SBSv2Utils.getSBSv2FilteredConfigs();
+ List<String> aliasFilterList = SBSv2Utils.getSBSv2FilteredConfigPreferences();
for (String aliasKey : sbsAliasMap.keySet()) {
if (!aliasFilterList.contains(aliasKey))
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java Wed Jun 16 12:09:43 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java Wed Jun 16 13:27:31 2010 -0500
@@ -72,13 +72,13 @@
if (aliasToMeaningMap.size() == 0)
aliasToMeaningMap = SBSv2QueryUtils.getAliasesForSDK(sdk);
- List<String> allowedConfigs = SBSv2Utils.getSBSv2FilteredConfigs(); // From global prefs
+ List<String> allowedConfigs = SBSv2Utils.getSBSv2FilteredConfigPreferences(); // From global prefs
if ((sbsv2FilteredConetxts == null || sbsv2FilteredConetxts.size() == 0)
&& SBSv2Utils.enableSBSv2Support()){
- if (!(new File(sdk.getEPOCROOT()).exists())){
- return sbsv2FilteredConetxts;
- }
+// if (!(new File(sdk.getEPOCROOT()).exists())){
+// return sbsv2FilteredConetxts;
+// }
List<String> filteredAliasList = new ArrayList<String>();
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java Wed Jun 16 12:09:43 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java Wed Jun 16 13:27:31 2010 -0500
@@ -114,7 +114,7 @@
tableViewer.setAllChecked(false);
// now check ones from the store
- List<String> uncheckedConfigs = SBSv2Utils.getSBSv2FilteredConfigs();
+ List<String> uncheckedConfigs = SBSv2Utils.getSBSv2FilteredConfigPreferences();
for (String config : uncheckedConfigs) {
for (TableItem item : tableViewer.getTable().getItems()) {
if (item.getText().equals(config)) {