Fix for Bug 11908 [SDK - Add/delete/re-scan an sdk the filtering configurations are not updated automatically].
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Thu Aug 26 10:40:47 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Thu Aug 26 13:25:57 2010 -0500
@@ -499,7 +499,8 @@
}
public void fireInstalledSdkChanged(SDKChangeEventType eventType) {
- for (ICarbideInstalledSDKChangeListener l : listeners) {
+ ListenerList<ICarbideInstalledSDKChangeListener> lList = listeners;
+ for (ICarbideInstalledSDKChangeListener l : lList) {
l.installedSdkChanged(eventType);
}
}
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java Thu Aug 26 10:40:47 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java Thu Aug 26 13:25:57 2010 -0500
@@ -48,6 +48,7 @@
import com.nokia.carbide.cpp.internal.sdk.core.model.SDKManager;
import com.nokia.carbide.cpp.internal.sdk.ui.AddSBSv2ProductVariant;
import com.nokia.carbide.cpp.internal.sdk.ui.Messages;
+import com.nokia.carbide.cpp.sdk.core.ICarbideInstalledSDKChangeListener;
import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID;
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
@@ -68,6 +69,13 @@
private Button addVariantButton;
private Button removeVariantButton;
+ private ICarbideInstalledSDKChangeListener sdkListener = new ICarbideInstalledSDKChangeListener() {
+ public void installedSdkChanged(SDKChangeEventType eventType) {
+ // refresh locally cached SBSv2 data whenever there is any change to SDK list
+ refreshLocalSBSCacheData();
+ }
+ };
+
SBSv2PlatformFilterComposite(Composite parent) {
super(parent, SWT.NONE);
}
@@ -123,8 +131,7 @@
refreshButton.setEnabled(false);
refreshButton.setText(Messages.getString("SBSv2PlatformFilterComposite.RefreshButtonScanningText")); //$NON-NLS-1$
SBSv2QueryUtils.removeAllCachedQueries();
- clearLocalSBSCacheData();
- initTable();
+ refreshLocalSBSCacheData();
for (ISymbianSDK sdk : SDKCorePlugin.getSDKManager().getSDKList()){
((SBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER)).clearDataFromBuildCache();
@@ -134,12 +141,6 @@
refreshButton.setEnabled(true);
}
- private void clearLocalSBSCacheData(){
- aliasMap.clear();
- productVariantList.clear();
- }
-
-
});
Composite variantButtonsComposite = new Composite(this, SWT.NONE);
@@ -216,6 +217,13 @@
});
initTable();
+ SDKCorePlugin.getSDKManager().addInstalledSdkChangeListener(sdkListener);
+ }
+
+ @Override
+ public void dispose() {
+ SDKCorePlugin.getSDKManager().removeInstalledSdkChangeListener(sdkListener);
+ super.dispose();
}
public void performOk() {
@@ -291,7 +299,13 @@
}
}
}
-
+
+ private void refreshLocalSBSCacheData() {
+ aliasMap.clear();
+ productVariantList.clear();
+ initTable();
+ }
+
public void setDefaults(){
initTable();
for (TableItem item : buildAliasTableViewer.getTable().getItems()) {