core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java
branchC3_BUILDER_WORK
changeset 1433 1a693b01d107
parent 1425 7903a1588fd4
child 1434 79471fd1fd69
child 1437 8534c28043b9
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java	Thu Jun 03 17:43:59 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java	Fri Jun 04 16:34:02 2010 -0500
@@ -21,15 +21,17 @@
 	private String platform;
 	private String target;
 	private String sbsv2Alias;
-	ISymbianSDK sdk;
+	private ISymbianSDK sdk;
+	private String displayString;
+	private String configID;  // cconfiguration 'id' attribute from .cproject
 	
-	public BuildContextSBSv2(ISymbianSDK theSDK, String thePlatform, String theTarget, String theSBSv2Alias) {
-		sdk = theSDK;
-		platform = thePlatform.toUpperCase();
-		target = theTarget.toUpperCase();
-		sbsv2Alias = theSBSv2Alias;
-		
-		getDisplayString();
+	public BuildContextSBSv2(ISymbianSDK theSDK, String thePlatform, String theTarget, String theSBSv2Alias, String displayName, String configID) {
+		this.sdk = theSDK;
+		this.platform = thePlatform.toUpperCase();
+		this.target = theTarget.toUpperCase();
+		this.sbsv2Alias = theSBSv2Alias;
+		this.displayString = displayName;
+		this.configID = configID;
 	}
 
 	@Override
@@ -47,21 +49,27 @@
 		return target;
 	}
 
+	public String getConfigID(){
+		return configID;
+	}
+	
 	@Override
 	public String getDisplayString() {
-		// TODO We will need to cobble up proper display names
-		//return "(" + sbsv2Alias + ") " + "[" + sdk.getUniqueId() + "]" ;
+		
 		
-		// TODO: This is temporary to support the old configs where
-		// The display name and id were the same thing. Need to work on supporting both
-		// as we migrate the display name to the settings and use a truly unique ID for configs.
+		// TODO: Still need to decide on how to set display string
+		// and how it's used for legacy SBSv2 configs
+		if (displayString != null && !displayString.equals(configID)){
+			return displayString;
+		}
 		
-		  String EMULATOR_DISPLAY_TEXT = "Emulator"; //$NON-NLS-1$
-		  String PHONE_DISPLAY_TEXT = "Phone"; //$NON-NLS-1$
-		  String DEBUG_DISPLAY_TEXT = "Debug"; //$NON-NLS-1$
-		  String RELEASE_DISPLAY_TEXT = "Release"; //$NON-NLS-1$
-		  String SPACE_DISPLAY_TEXT = " "; //$NON-NLS-1$
-		  String SDK_NOT_INSTALLED = "SDK not installed"; //$NON-NLS-1$
+		// TODO: else fallback for old configs, we should convert
+		String EMULATOR_DISPLAY_TEXT = "Emulator"; //$NON-NLS-1$
+		String PHONE_DISPLAY_TEXT = "Phone"; //$NON-NLS-1$
+		String DEBUG_DISPLAY_TEXT = "Debug"; //$NON-NLS-1$
+		String RELEASE_DISPLAY_TEXT = "Release"; //$NON-NLS-1$
+		String SPACE_DISPLAY_TEXT = " "; //$NON-NLS-1$
+		String SDK_NOT_INSTALLED = "SDK not installed"; //$NON-NLS-1$
 		String displayString = null;
 		if (displayString == null) {
 			// in the form Emulation Debug (WINSCW) [S60_3rd_MR] or
@@ -86,6 +94,11 @@
 	}
 
 	@Override
+	public String toString() {
+		return getConfigID();
+	}
+
+	@Override
 	public String getDefaultDefFileDirectoryName(boolean isASSP) {
 		// TOOD: THIS IS ABLD STUFF. isASSP does not belong with Raptor
 		// TODO: How the ASSP option affects the path?
@@ -337,6 +350,9 @@
 				return false;
 		} else if (!target.equals(other.target)) {
 			return false;
+		} else if (!configID.equals(other.configID)){
+			// TODO: Do we really need anything other than a config ID comparison?
+			return false;
 		}
 		return true;
 	}