mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 11:15:38 +02:00
Bug #176040 : build option changes not correctly propagated in new project model
This commit is contained in:
parent
55873833c6
commit
a91baa485b
2 changed files with 18 additions and 20 deletions
|
@ -74,7 +74,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
IHoldsOptions holder = (IHoldsOptions)options[index][0];
|
IHoldsOptions holder = (IHoldsOptions)options[index][0];
|
||||||
if (holder == null) break; // The array may not be full
|
if (holder == null) break; // The array may not be full
|
||||||
IOption opt = (IOption)options[index][1];
|
IOption opt = (IOption)options[index][1];
|
||||||
String prefName = opt.getName();
|
String optId = getToolSettingsPrefStore().getOptionId(opt);
|
||||||
|
|
||||||
// check to see if the option has an applicability calculator
|
// check to see if the option has an applicability calculator
|
||||||
IOptionApplicability applicabilityCalculator = opt.getApplicabilityCalculator();
|
IOptionApplicability applicabilityCalculator = opt.getApplicabilityCalculator();
|
||||||
|
@ -96,15 +96,15 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
// browse button of the appropriate type.
|
// browse button of the appropriate type.
|
||||||
switch (opt.getBrowseType()) {
|
switch (opt.getBrowseType()) {
|
||||||
case IOption.BROWSE_DIR: {
|
case IOption.BROWSE_DIR: {
|
||||||
stringField = new DirectoryFieldEditor(prefName, opt.getName(), fieldEditorParent);
|
stringField = new DirectoryFieldEditor(optId, opt.getName(), fieldEditorParent);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case IOption.BROWSE_FILE: {
|
case IOption.BROWSE_FILE: {
|
||||||
stringField = new FileFieldEditor(prefName, opt.getName(), fieldEditorParent);
|
stringField = new FileFieldEditor(optId, opt.getName(), fieldEditorParent);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case IOption.BROWSE_NONE: {
|
case IOption.BROWSE_NONE: {
|
||||||
stringField = new StringFieldEditor(prefName, opt.getName(), fieldEditorParent);
|
stringField = new StringFieldEditor(optId, opt.getName(), fieldEditorParent);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
|
@ -126,7 +126,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldEditor = new TooltipBooleanFieldEditor(prefName, opt.getName(), opt.getToolTip(), fieldEditorParent);
|
fieldEditor = new TooltipBooleanFieldEditor(optId, opt.getName(), opt.getToolTip(), fieldEditorParent);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case IOption.ENUMERATED: {
|
case IOption.ENUMERATED: {
|
||||||
|
@ -148,7 +148,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
String[] enumValidNames = new String[enumValidList.size()];
|
String[] enumValidNames = new String[enumValidList.size()];
|
||||||
enumValidList.copyInto(enumValidNames);
|
enumValidList.copyInto(enumValidNames);
|
||||||
|
|
||||||
fieldEditor = new BuildOptionComboFieldEditor(prefName, opt.getName(), opt.getToolTip(), enumValidNames, sel, fieldEditorParent);
|
fieldEditor = new BuildOptionComboFieldEditor(optId, opt.getName(), opt.getToolTip(), enumValidNames, sel, fieldEditorParent);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case IOption.INCLUDE_PATH:
|
case IOption.INCLUDE_PATH:
|
||||||
|
@ -161,7 +161,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
case IOption.LIBRARY_FILES:
|
case IOption.LIBRARY_FILES:
|
||||||
case IOption.MACRO_FILES:
|
case IOption.MACRO_FILES:
|
||||||
{
|
{
|
||||||
fieldEditor = new FileListControlFieldEditor(prefName, opt.getName(), opt.getToolTip(), fieldEditorParent, opt.getBrowseType());
|
fieldEditor = new FileListControlFieldEditor(optId, opt.getName(), opt.getToolTip(), fieldEditorParent, opt.getBrowseType());
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -171,7 +171,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
setFieldEditorEnablement(holder, opt, applicabilityCalculator, fieldEditor, fieldEditorParent);
|
setFieldEditorEnablement(holder, opt, applicabilityCalculator, fieldEditor, fieldEditorParent);
|
||||||
|
|
||||||
addField(fieldEditor);
|
addField(fieldEditor);
|
||||||
fieldsMap.put(prefName, fieldEditor);
|
fieldsMap.put(optId, fieldEditor);
|
||||||
fieldEditorsToParentMap.put(fieldEditor, fieldEditorParent);
|
fieldEditorsToParentMap.put(fieldEditor, fieldEditorParent);
|
||||||
|
|
||||||
} catch (BuildException e) {
|
} catch (BuildException e) {
|
||||||
|
@ -321,7 +321,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
if (holder == null)
|
if (holder == null)
|
||||||
break; // The array may not be full
|
break; // The array may not be full
|
||||||
IOption opt = (IOption) options[index][1];
|
IOption opt = (IOption) options[index][1];
|
||||||
String prefName = getToolSettingsPrefStore().getOptionPrefName(opt);
|
String prefName = getToolSettingsPrefStore().getOptionId(opt);
|
||||||
|
|
||||||
// is the option on this page?
|
// is the option on this page?
|
||||||
if (fieldsMap.containsKey(prefName)) {
|
if (fieldsMap.containsKey(prefName)) {
|
||||||
|
@ -375,7 +375,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
|
|
||||||
id = fe.getPreferenceName();
|
id = fe.getPreferenceName();
|
||||||
|
|
||||||
Object option[] = this.getToolSettingsPrefStore().getOption(id);
|
Object[] option = this.getToolSettingsPrefStore().getOption(id);
|
||||||
|
|
||||||
if(option != null){
|
if(option != null){
|
||||||
changedOption = (IOption)option[1];
|
changedOption = (IOption)option[1];
|
||||||
|
@ -434,14 +434,14 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
if (holder == null)
|
if (holder == null)
|
||||||
break; // The array may not be full
|
break; // The array may not be full
|
||||||
IOption opt = (IOption) options[index][1];
|
IOption opt = (IOption) options[index][1];
|
||||||
String prefName = getToolSettingsPrefStore().getOptionPrefName(opt);
|
String optId = getToolSettingsPrefStore().getOptionId(opt);
|
||||||
|
|
||||||
// is the option on this page?
|
// is the option on this page?
|
||||||
if (fieldsMap.containsKey(prefName)) {
|
if (fieldsMap.containsKey(optId)) {
|
||||||
// check to see if the option has an applicability calculator
|
// check to see if the option has an applicability calculator
|
||||||
IOptionApplicability applicabilityCalculator = opt.getApplicabilityCalculator();
|
IOptionApplicability applicabilityCalculator = opt.getApplicabilityCalculator();
|
||||||
|
|
||||||
FieldEditor fieldEditor = (FieldEditor) fieldsMap.get(prefName);
|
FieldEditor fieldEditor = (FieldEditor) fieldsMap.get(optId);
|
||||||
try {
|
try {
|
||||||
if ( opt.getValueType() == IOption.ENUMERATED ) {
|
if ( opt.getValueType() == IOption.ENUMERATED ) {
|
||||||
// the item list of this enumerated option may have changed, update it
|
// the item list of this enumerated option may have changed, update it
|
||||||
|
@ -481,8 +481,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
* @param config project or resource info
|
* @param config project or resource info
|
||||||
* @throws BuildException
|
* @throws BuildException
|
||||||
*/
|
*/
|
||||||
protected void updateEnumList( FieldEditor fieldEditor, IOption opt, IHoldsOptions holder, IResourceInfo config ) throws BuildException
|
protected void updateEnumList( FieldEditor fieldEditor, IOption opt, IHoldsOptions holder, IResourceInfo config ) throws BuildException {
|
||||||
{
|
|
||||||
// Get all applicable values for this enumerated Option, and filter out
|
// Get all applicable values for this enumerated Option, and filter out
|
||||||
// the disable values
|
// the disable values
|
||||||
String[] enumNames = opt.getApplicableValues();
|
String[] enumNames = opt.getApplicableValues();
|
||||||
|
|
|
@ -64,7 +64,7 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
|
||||||
return rcInfo.getParent();
|
return rcInfo.getParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOptionPrefName(IOption option){
|
public String getOptionId(IOption option){
|
||||||
IOption extOption = getExtensionOption(option);
|
IOption extOption = getExtensionOption(option);
|
||||||
if(extOption != null)
|
if(extOption != null)
|
||||||
return extOption.getId();
|
return extOption.getId();
|
||||||
|
@ -196,7 +196,7 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object[] getOption(String name){
|
public Object[] getOption(String id){
|
||||||
if (selectedElement == null) return null;
|
if (selectedElement == null) return null;
|
||||||
|
|
||||||
IHoldsOptions selectedHolder = selectedElement.getHoldOptions();
|
IHoldsOptions selectedHolder = selectedElement.getHoldOptions();
|
||||||
|
@ -209,11 +209,10 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
|
||||||
|
|
||||||
IOption option = (IOption)options[i][1];
|
IOption option = (IOption)options[i][1];
|
||||||
|
|
||||||
String optionName = option.getName();
|
if( ( option.getId().equals(id))
|
||||||
if( ((optionName != null) && optionName.equals(name)) //TODO: name vs ID !
|
|
||||||
|| ((!option.isExtensionElement() || ((Option)option).isAdjustedExtension() || ((Option)option).wasOptRef())
|
|| ((!option.isExtensionElement() || ((Option)option).isAdjustedExtension() || ((Option)option).wasOptRef())
|
||||||
&& option.getSuperClass() != null
|
&& option.getSuperClass() != null
|
||||||
&& option.getSuperClass().getId().equals(name)))
|
&& option.getSuperClass().getId().equals(id)))
|
||||||
return options[i];
|
return options[i];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue