Updated support for adding/removing missing SDK. C3_BUILDER_WORK
authorstechong
Mon, 26 Jul 2010 12:02:37 -0500
branchC3_BUILDER_WORK
changeset 1682 2ee63cbf206a
parent 1681 6636e8c75e66
child 1683 659fdb7ee701
Updated support for adding/removing missing SDK.
core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SDKManagerInternalAPI.java
core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SDKManagerInternalAPI.java	Mon Jul 26 11:32:21 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SDKManagerInternalAPI.java	Mon Jul 26 12:02:37 2010 -0500
@@ -19,10 +19,18 @@
 
 public class SDKManagerInternalAPI {
 	    
+    public static void addMissingSdk(ISymbianSDK sdk) {
+    	((AbstractSDKManager)SDKCorePlugin.getSDKManager()).addMissingSdk(sdk);
+    }
+    
     public static ISymbianSDK addMissingSdk(String uid) {
     	return ((AbstractSDKManager)SDKCorePlugin.getSDKManager()).addMissingSdk(uid);
     }
     
+    public static void removeMissingSdk(ISymbianSDK sdk) {
+    	((AbstractSDKManager)SDKCorePlugin.getSDKManager()).removeMissingSdk(sdk);
+    }
+    
     public static void removeMissingSdk(String uid) {
     	((AbstractSDKManager)SDKCorePlugin.getSDKManager()).removeMissingSdk(uid);
     }
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java	Mon Jul 26 11:32:21 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java	Mon Jul 26 12:02:37 2010 -0500
@@ -183,8 +183,7 @@
 			// now these SDK's are newly added, remove from internal list
 			for (ISymbianSDK sdk : sdkList) {
 				if (SDKManagerInternalAPI.getMissingSdk(sdk.getUniqueId()) != null) {
-					SDKManagerInternalAPI.removeMissingSdk(sdk
-							.getUniqueId());
+					SDKManagerInternalAPI.removeMissingSdk(sdk);
 				}
 			}
 
@@ -199,8 +198,7 @@
 					}
 				}
 				if (found == false) {
-					SDKManagerInternalAPI.addMissingSdk(oldSdk
-							.getUniqueId());
+					SDKManagerInternalAPI.addMissingSdk(oldSdk);
 					// flush cache
 					SymbianBuildContextDataCache.refreshForSDKs(new ISymbianSDK[] { oldSdk });
 				}
@@ -285,7 +283,7 @@
 			try {
 				sdkList.add(sdk);
 				updateSDK(sdk);
-				SDKManagerInternalAPI.removeMissingSdk(sdk.getUniqueId());
+				SDKManagerInternalAPI.removeMissingSdk(sdk);
 				// tell others about it
 				fireInstalledSdkChanged(SDKChangeEventType.eSDKAdded);
 			}
@@ -305,7 +303,7 @@
 					if (currSDK.getUniqueId().equals(sdkId)){
 						sdkList.remove(currSDK);
 						
-						SDKManagerInternalAPI.addMissingSdk(currSDK.getUniqueId());
+						SDKManagerInternalAPI.addMissingSdk(currSDK);
 						
 						// tell others about it
 						fireInstalledSdkChanged(SDKChangeEventType.eSDKRemoved);
@@ -600,6 +598,10 @@
 		return rvctToolList;
 	}
 	
+    public void addMissingSdk(ISymbianSDK sdk) {
+		missingSdkMap.put(sdk.getUniqueId(), sdk);
+    }
+    
     public ISymbianSDK addMissingSdk(String uid) {
 		ISymbianSDK sdk = getMissingSdk(uid);
 		if (sdk == null) {
@@ -609,6 +611,10 @@
     	return sdk;
     }
     
+    public void removeMissingSdk(ISymbianSDK sdk) {
+    	missingSdkMap.remove(sdk.getUniqueId());
+    }
+    
     public void removeMissingSdk(String uid) {
     	missingSdkMap.remove(uid);
     }