Skip to main content
summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorAndrew Gvozdev2011-09-22 15:28:01 -0400
committerAndrew Gvozdev2011-09-22 15:29:47 -0400
commit6a63d0325fc79e06d9ccc28658005758b344a492 (patch)
tree18bcbb3930a4d1a646a7500d4337bf5999718f4d /build
parent9ec9113700a2a06a9de497085d6d55b090907f60 (diff)
downloadorg.eclipse.cdt-6a63d0325fc79e06d9ccc28658005758b344a492.tar.gz
org.eclipse.cdt-6a63d0325fc79e06d9ccc28658005758b344a492.tar.xz
org.eclipse.cdt-6a63d0325fc79e06d9ccc28658005758b344a492.zip
bug 358605: No environment variables imported to new cfg while importing
configuration from another project in Manage Configurations dialog
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java
index f6f93d3857..9a063484f7 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewCfgDialog.java
@@ -17,6 +17,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
@@ -35,6 +36,7 @@ import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
import org.eclipse.cdt.managedbuilder.ui.wizards.MBSWizardHandler;
import org.eclipse.cdt.ui.newui.INewCfgDialog;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -544,7 +546,20 @@ public class NewCfgDialog implements INewCfgDialog {
ICConfigurationDescription base = ManagedBuildManager.getDescriptionForConfiguration(parentConfig);
cfgDes = des.createConfiguration(id, newName, base);
cfgDes.setDescription(newDescription);
- } else {
+ } else if (b_importFromOtherProject.getSelection()) {
+ IResource owner = parentConfig.getOwner();
+ if (owner!=null) {
+ // need writable cfg description for cloning
+ ICProjectDescription prjDesOther = CCorePlugin.getDefault().getProjectDescription(owner.getProject(), true);
+ ICConfigurationDescription base = prjDesOther.getConfigurationByName(parentConfig.getName());
+ if (base != null) {
+ cfgDes = des.createConfiguration(id, newName, base);
+ cfgDes.setDescription(newDescription);
+ }
+ }
+ }
+ if (cfgDes == null) {
+ // when "Default" or "Predefined" selected or import from other project failed
CConfigurationData data = config.getConfigurationData();
cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
}

Back to the top