Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] ManagedBuildInfo.getSelectedConfiguration

You should file bug anyway, but I don't think it should be removed, it should be fixed. Isn't it suppose to be configuration which is
selected in the project properties?

Vladimir Prus wrote:
Can somebody tell what is the intended purpose of the ManagedBuildManager.getSelectedConfiguration
method. As far as I can see, it's not used anywhere, which makes ManagedBuildInfo.getSelectedConfiguration also unused. ManagedBuildInfo.setSelectedConfiguration
is called in a couple of places, but given that the set value is not used, that seems of no use.
The patch below removes this method, and CDT still builds fine. Does anybody see any reason
this patch is bad, or should I file in in Bugzilla?

Thanks,
Volodya

### Eclipse Workspace Patch 1.0
#P org.eclipse.cdt.managedbuilder.core
Index: src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java,v
retrieving revision 1.22
diff -u -r1.22 IManagedBuildInfo.java
--- src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java	8 Feb 2008 16:39:16 -0000	1.22
+++ src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java	2 Nov 2008 09:58:57 -0000
@@ -310,14 +310,6 @@
 	 * @return the prefix or an empty string
 	 */
 	public String getOutputPrefix(String outputExtension);
-	
-	/**
-	 * Returns the currently selected configuration.  This is used while the project
-	 * property pages are displayed
- * - * @return IConfiguration
-	 */
-	public IConfiguration getSelectedConfiguration();
/**
 	 * Get the target specified in the argument.
@@ -490,12 +482,4 @@
 	 * @param <code>true</code> will force a rebuild the next time the project builds
 	 */
 	public void setRebuildState(boolean rebuild);
-	
-	/**
- * Sets the currently selected configuration. This is used while the project - * property pages are displayed - * - * @param configuration the user selection
-	 */
-	public void setSelectedConfiguration(IConfiguration configuration);
 }
Index: src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java,v
retrieving revision 1.118
diff -u -r1.118 ManagedBuildManager.java
--- src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java	28 Apr 2008 18:35:14 -0000	1.118
+++ src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java	2 Nov 2008 09:58:58 -0000
@@ -852,24 +852,6 @@
 	}
 	
 	/**
-	 * Sets the currently selected configuration.  This is used while the project
-	 * property pages are displayed
- * - * @param project
-	 * @param target
-	 */
-	public static void setSelectedConfiguration(IProject project, IConfiguration config) {
-		if (project == null) {
-			return;
-		}
- // Set the default in build information for the project - IManagedBuildInfo info = getBuildInfo(project);
-		if (info != null) {
-			info.setSelectedConfiguration(config);
-		}
-	}
-
-	/**
 	 * @param targetId
 	 * @return
 	 */
@@ -909,26 +891,7 @@
         IToolChain toolChain = config.getToolChain();
         return toolChain.getScannerConfigDiscoveryProfileId();
     }
- - /**
-	 * Gets the currently selected target.  This is used while the project
-	 * property pages are displayed
- * - * @param project
-	 * @return target
-	 */
-	public static IConfiguration getSelectedConfiguration(IProject project) {
-		if (project == null) {
-			return null;
-		}
- // Set the default in build information for the project - IManagedBuildInfo info = getBuildInfo(project);
-		if (info != null) {
-			return info.getSelectedConfiguration();
-		}
-		return null;
-	}
-	
+    	
 	/* (non-Javadoc)
* * @param config
Index: src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java,v
retrieving revision 1.18
diff -u -r1.18 UpdateManagedProject12.java
--- src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java	29 Apr 2008 16:53:07 -0000	1.18
+++ src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java	2 Nov 2008 09:58:58 -0000
@@ -729,15 +729,13 @@
 				String oldDefaultConfigId = defaultConfig.getAttribute(IBuildObject.ID);
 				IConfiguration newDefaultConfig = (IConfiguration) getConfigIdMap().get(oldDefaultConfigId);
 				if (newDefaultConfig != null) {
-					info.setDefaultConfiguration(newDefaultConfig);
-					info.setSelectedConfiguration(newDefaultConfig);
+					info.setDefaultConfiguration(newDefaultConfig);					
 				} else {
 			        // The only safe thing to do if there wasn't a default configuration for a built-in
 			        // target is to set the first defined configuration as the default
 			        IConfiguration[] newConfigs = newProject.getConfigurations();
 			        if (newConfigs.length > 0) {
-			            info.setDefaultConfiguration(newConfigs[0]);
-			            info.setSelectedConfiguration(newConfigs[0]);
+ info.setDefaultConfiguration(newConfigs[0]); }
 				}
 			} catch (IndexOutOfBoundsException e) {
Index: src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java,v
retrieving revision 1.14
diff -u -r1.14 UpdateManagedProject20.java
--- src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java	29 Apr 2008 16:53:07 -0000	1.14
+++ src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java	2 Nov 2008 09:58:58 -0000
@@ -166,8 +166,7 @@
 			IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
 			IConfiguration[] newConfigs = newProject.getConfigurations();
 			if (newConfigs.length > 0) {
-				info.setDefaultConfiguration(newConfigs[0]);
-				info.setSelectedConfiguration(newConfigs[0]);
+				info.setDefaultConfiguration(newConfigs[0]);				
 			}
 			else{
 				throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
Index: src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java,v
retrieving revision 1.68
diff -u -r1.68 ManagedBuildInfo.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java	30 May 2007 11:54:44 -0000	1.68
+++ src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java	2 Nov 2008 09:58:58 -0000
@@ -84,8 +84,7 @@
 	private boolean isValid = false;
 	private IResource owner;
 	private boolean rebuildNeeded;
-	private String version;
-	private IConfiguration selectedConfig;
+	private String version;	
private List targetList;
 	private Map targetMap;
@@ -923,20 +922,6 @@
 		}
 	}
 	
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getSelectedConfiguration()
-	 */
-	public IConfiguration getSelectedConfiguration() {
-		return selectedConfig;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#setSelectedConfiguration(org.eclipse.cdt.core.build.managed.IConfiguration)
-	 */
-	public void setSelectedConfiguration(IConfiguration config) {
-		selectedConfig = config;
-	}
-
 	/*
 	 * Note:  "Target" routines are only currently applicable when loading a CDT 2.0
 	 *        or earlier managed build project file (.cdtbuild)
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top