Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37757021
en ru br
ALT Linux repos
5.0: 5.0.1-alt1_1jpp6
4.1: 4.0.1-alt1_1jpp5.0
4.0: 4.0.1-alt1_1jpp5.0
3.0: 2.1.0-alt1

Group :: Development/Java
RPM: eclipse-cdt

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: eclipse-cdt-managedConfigurations-fix.patch
Download


Index: src/org/eclipse/cdt/ui/newui/AbstractPage.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java,v
retrieving revision 1.63
diff -u -r1.63 AbstractPage.java
--- src/org/eclipse/cdt/ui/newui/AbstractPage.java	29 May 2008 10:31:51 -0000	1.63
+++ src/org/eclipse/cdt/ui/newui/AbstractPage.java	6 Nov 2008 00:37:18 -0000
@@ -68,6 +68,7 @@
 import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation;
 import org.eclipse.ui.dialogs.PropertyPage;
 
+import org.eclipse.cdt.core.CCorePlugin;
 import org.eclipse.cdt.core.model.CoreModel;
 import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.cdt.core.model.ICProject;
@@ -79,6 +80,7 @@
 import org.eclipse.cdt.core.settings.model.ICProjectDescription;
 import org.eclipse.cdt.core.settings.model.ICResourceDescription;
 import org.eclipse.cdt.core.settings.model.MultiItemsHolder;
+import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
 import org.eclipse.cdt.ui.CUIPlugin;
 import org.eclipse.cdt.ui.PreferenceConstants;
 import org.eclipse.cdt.utils.ui.controls.ControlFactory;
@@ -468,7 +470,7 @@
      *  
      *  @param prj - project description where we'll search (or create) config description
      *  @param cfg - config description belonging to another project description, 
-     *               it is a sample for search and base for possile creation
+     *               it is a sample for search and base for possible creation
      *               of resulting configuration description.
      *                  
      *  @return the configuration description (found or created) or null in case of error
@@ -479,11 +481,27 @@
 		ICConfigurationDescription c = prj.getConfigurationById(id);
 		// if there's no cfg found, try to create it
 		if (c == null) {
-			try {
-				c = prj.createConfiguration(id, cfg.getName(), cfg);
-				c.setDescription(cfg.getDescription());
-			} catch (CoreException e) { 
-				/* do nothing: c is already null */ 
+			// see if this is a configuration that is known to the project description cached by the
+			// CDTPropertyPage (e.g. config has been added via New Configuration Dialog)
+			ICProjectDescription prj2 = CDTPropertyManager.getProjectDescription(AbstractPage.this, getProject());
+			ICConfigurationDescription c2 = prj2.getConfigurationById(id);
+			if (c2 != null) {
+				// cfg found...let's use the same build system id and create it on the 
+				// project description passed in
+				try {
+					CConfigurationData data = cfg.getConfigurationData();
+					c = prj.createConfiguration(c2.getBuildSystemId(), data);
+				} catch (CoreException e) {
+					/* do nothing: c is already null */
+				}
+			} else {
+				// not found..let's create it anyway
+				try {
+					CConfigurationData data = cfg.getConfigurationData();
+					c = prj.createConfiguration(CCorePlugin.DEFAULT_PROVIDER_ID, data);
+				} catch (CoreException e) {
+					/* do nothing: c is already null */
+				}
 			}
 		}
 		// if creation failed, report an error and return null
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin