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