merged fix for bug #10641. RCL_2_4
authorwpaul
Tue, 02 Feb 2010 18:56:30 -0600
branchRCL_2_4
changeset 885 14d07a3e6c84
parent 882 e5207e7f4eb1
child 887 f3e6336d8edb
merged fix for bug #10641.
core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/DynamicFeatureInstaller.java
core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/NewPluginChecker.java
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/DynamicFeatureInstaller.java	Tue Feb 02 13:56:35 2010 -0600
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/DynamicFeatureInstaller.java	Tue Feb 02 18:56:30 2010 -0600
@@ -93,13 +93,13 @@
 		// Having a manifest does not require that you actually install anything. So errors should not be thrown.
 		// You simply should not run the dynamic installer if the SDK has nothing to install.
 		if (!featureDirectory.isDirectory()) {
-			//throw new FileNotFoundException(featureDirectory + " is not a directory.");
+			throw new FileNotFoundException(featureDirectory + " is not a directory.");
 		}
 		if (!(new File(featureDirectory, "features").isDirectory())) {
-			//throw new FileNotFoundException(featureDirectory + " does not contain \"features\" directory.");
+			throw new FileNotFoundException(featureDirectory + " does not contain \"features\" directory.");
 		}
 		if (!(new File(featureDirectory, "plugins").isDirectory())) {
-			//throw new FileNotFoundException(featureDirectory + " does not contain \"plugins\" directory.");
+			throw new FileNotFoundException(featureDirectory + " does not contain \"plugins\" directory.");
 		}
 	}
 
@@ -113,7 +113,7 @@
 	 *                        the installation progress as a Progress Bar to the user.
 	 *                        Can be null. 
 	 */
-	public DynamicFeatureInstaller(URL featureDirectoryURL, IProgressMonitor progressMonitor) {
+	private DynamicFeatureInstaller(URL featureDirectoryURL, IProgressMonitor progressMonitor) {
 		this.featureURL = featureDirectoryURL;
 		this.progressMonitor = progressMonitor;
 	}
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/NewPluginChecker.java	Tue Feb 02 13:56:35 2010 -0600
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/NewPluginChecker.java	Tue Feb 02 18:56:30 2010 -0600
@@ -17,7 +17,6 @@
 package com.nokia.carbide.cpp.internal.sdk.ui;
 
 import com.nokia.carbide.cpp.internal.sdk.core.model.DynamicFeatureInstaller;
-import com.nokia.carbide.cpp.internal.sdk.core.model.InstallationFailureException;
 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
 import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
 import com.nokia.carbide.cpp.sdk.ui.SDKUIPlugin;
@@ -31,14 +30,12 @@
 import org.eclipse.ui.IWorkbenchWindow;
 
 import java.io.File;
-import java.io.FileNotFoundException;
-import java.net.MalformedURLException;
 import java.util.List;
 
 @SuppressWarnings("restriction")
 public class NewPluginChecker {
 
-	private static final String SDK_FEATURE_SUBDIR = "epoc32/kit/feature";  //$NON-NLS-1$
+	private static final String SDK_FEATURE_SUBDIR = "epoc32/kit";  //$NON-NLS-1$
 	
 	public static void checkForNewlyInstalledPlugins(final IWorkbench workbench){
 		final List<ISymbianSDK> sdkList = SDKCorePlugin.getSDKManager().getSDKList();
@@ -49,28 +46,23 @@
 				boolean oneSDKWasScanned = false;
 				for (ISymbianSDK sdk : sdkList) {
 					
-					if (sdk.isPreviouslyScanned() == false){
+					if (sdk.isPreviouslyScanned() == false) {
 						oneSDKWasScanned = true;
 						// XML was parsed, now try to run the feature installer
+						sdk.setPreviouslyScanned(true);
+
 						try {
-							sdk.setPreviouslyScanned(true);
-							String eclipsePluginsPath = sdk.getEPOCROOT() + SDK_FEATURE_SUBDIR;
-							DynamicFeatureInstaller installer = new DynamicFeatureInstaller(new File(eclipsePluginsPath), null);
+							DynamicFeatureInstaller installer = new DynamicFeatureInstaller(new File(sdk.getEPOCROOT() + SDK_FEATURE_SUBDIR), null);
 							if (installer.install()) {
 								installed = true;
 							}
-	// Boog 8383: We should fail silently, since this will not break anything and may SDKs will not have any documentation
-	// Otherwise, these errors will be logged every time this check is done (workspace is opened)
-	// Originally, this was used to install MBS build support, but now is only used for SDK documentation
-						} catch (MalformedURLException e) {
-	//						ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.PLUGIN_ID, IStatus.ERROR, "Unable to install plug-ins dynamically.", e));
-						} catch (FileNotFoundException e) {
-	//						ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.PLUGIN_ID, IStatus.ERROR, "Unable to install plug-ins dynamically.", e));
-						} catch (InstallationFailureException e) {
+						} catch (Exception e) {
+							// Boog 8383: We should fail silently, since this will not break anything and may SDKs will not have any documentation
+							// Otherwise, these errors will be logged every time this check is done (workspace is opened)
+							// Originally, this was used to install MBS build support, but now is only used for SDK documentation
 	//						ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.PLUGIN_ID, IStatus.ERROR, "Unable to install plug-ins dynamically.", e));
 						}
 					}
-					
 				}
 				
 				if (oneSDKWasScanned) {