Updated SDK manager to attempt removing SDK from devicex.xml only when the SDK is originally defined in the file.
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Wed Jun 16 22:25:08 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Wed Jun 16 22:40:10 2010 -0500
@@ -44,7 +44,6 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.IJobChangeListener;
import org.eclipse.core.runtime.jobs.Job;
import org.osgi.framework.Version;
@@ -70,6 +69,7 @@
import com.nokia.carbide.cpp.sdk.core.ISDKManager;
import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID;
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
import com.nokia.carbide.cpp.sdk.core.SymbianSDKFactory;
import com.nokia.cpp.internal.api.utils.core.FileUtils;
@@ -111,7 +111,7 @@
/**
* Minimum SBSv2 version supported with Carbide
*/
- public static final Version MINIMUM_RAPTOR_VERSION = new Version(2, 15, 0);
+ public static final Version MINIMUM_RAPTOR_VERSION = new Version(2, 8, 6);
static boolean hasScannedSDKs = false; // make sure we only scan SDKs when needed
@@ -129,20 +129,6 @@
*/
protected static ListenerList<ICarbideDevicesXMLChangeListener> devicesXMLListeners = new ListenerList<ICarbideDevicesXMLChangeListener>();
- IJobChangeListener scanJobListener = new IJobChangeListener() {
-
- public void sleeping(IJobChangeEvent event) {}
- public void scheduled(IJobChangeEvent event) {}
- public void running(IJobChangeEvent event) {}
- public void awake(IJobChangeEvent event) {}
- public void aboutToRun(IJobChangeEvent event) {}
-
- public void done(IJobChangeEvent event) {
- fireInstalledSdkChanged(SDKChangeEventType.eSDKScanned);
- }
-
- };
-
public AbstractSDKManager() {
macroStore = SymbianMacroStore.getInstance();
@@ -152,8 +138,6 @@
return handleScan(monitor);
}
};
-
- addScanJobListner(scanJobListener);
}
public SymbianMacroStore getSymbianMacroStore(){
@@ -218,6 +202,7 @@
hasScannedSDKs = true;
// tell others about it
+ fireInstalledSdkChanged(SDKChangeEventType.eSDKScanned);
scanCarbideSDKCache();
updateCarbideSDKCache();
@@ -241,13 +226,13 @@
abstract protected boolean doScanSDKs(IProgressMonitor monitor);
public void addScanJobListner(IJobChangeListener listener) {
- if (scanJob != null && listener != null) {
+ if (scanJob != null) {
scanJob.addJobChangeListener(listener);
}
}
public void removeScanJobLisner(IJobChangeListener listener) {
- if (scanJob != null && listener != null) {
+ if (scanJob != null) {
scanJob.removeJobChangeListener(listener);
}
}
@@ -320,8 +305,11 @@
// tell others about it
fireInstalledSdkChanged(SDKChangeEventType.eSDKRemoved);
-
- doRemoveSDK(sdkId);
+
+ // only remove sdk from devices.xml if the sdk is defined in it
+ if (((SymbianSDK)currSDK).getSupportedFeatures().contains(ISymbianSDKFeatures.IS_FROM_DEVICES_XML)) {
+ doRemoveSDK(sdkId);
+ }
break;
}
@@ -880,6 +868,6 @@
return;
}
-
+
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java Wed Jun 16 22:25:08 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java Wed Jun 16 22:40:10 2010 -0500
@@ -136,7 +136,7 @@
}
protected boolean doRemoveSDK(String sdkId) {
- // Now actually remove it from the file...
+ // Now actually remove it from devices.xml...
DevicesType devicesType;
try {
File devicesFile = getDevicesXMLFile();
@@ -156,7 +156,7 @@
return true;
} catch (Exception e) {
- logError("Failed to remove SDK", e);
+ logError("Failed to remove SDK from devices.xml", e);
}
return false;