mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix *Dirty to account for new children
This commit is contained in:
parent
7197ddb46d
commit
f4ecd61137
2 changed files with 40 additions and 0 deletions
|
@ -1105,6 +1105,19 @@ public class InputType extends BuildObject implements IInputType {
|
||||||
public boolean isDirty() {
|
public boolean isDirty() {
|
||||||
// This shouldn't be called for an extension InputType
|
// This shouldn't be called for an extension InputType
|
||||||
if (isExtensionInputType) return false;
|
if (isExtensionInputType) return false;
|
||||||
|
|
||||||
|
// Check my children
|
||||||
|
Iterator typeIter = getInputOrderList().iterator();
|
||||||
|
while (typeIter.hasNext()) {
|
||||||
|
InputOrder current = (InputOrder)typeIter.next();
|
||||||
|
if (current.isDirty()) return true;
|
||||||
|
}
|
||||||
|
typeIter = getAdditionalInputList().iterator();
|
||||||
|
while (typeIter.hasNext()) {
|
||||||
|
AdditionalInput current = (AdditionalInput)typeIter.next();
|
||||||
|
if (current.isDirty()) return true;
|
||||||
|
}
|
||||||
|
|
||||||
return isDirty;
|
return isDirty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1113,6 +1126,19 @@ public class InputType extends BuildObject implements IInputType {
|
||||||
*/
|
*/
|
||||||
public void setDirty(boolean isDirty) {
|
public void setDirty(boolean isDirty) {
|
||||||
this.isDirty = isDirty;
|
this.isDirty = isDirty;
|
||||||
|
// Propagate "false" to the children
|
||||||
|
if (!isDirty) {
|
||||||
|
Iterator typeIter = getInputOrderList().iterator();
|
||||||
|
while (typeIter.hasNext()) {
|
||||||
|
InputOrder current = (InputOrder)typeIter.next();
|
||||||
|
current.setDirty(false);
|
||||||
|
}
|
||||||
|
typeIter = getAdditionalInputList().iterator();
|
||||||
|
while (typeIter.hasNext()) {
|
||||||
|
AdditionalInput current = (AdditionalInput)typeIter.next();
|
||||||
|
current.setDirty(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
|
@ -2265,6 +2265,20 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory {
|
||||||
// If I need saving, just say yes
|
// If I need saving, just say yes
|
||||||
if (isDirty) return true;
|
if (isDirty) return true;
|
||||||
|
|
||||||
|
// Check my children
|
||||||
|
List typeElements = getInputTypeList();
|
||||||
|
Iterator iter = typeElements.listIterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
InputType type = (InputType) iter.next();
|
||||||
|
if (type.isDirty()) return true;
|
||||||
|
}
|
||||||
|
typeElements = getOutputTypeList();
|
||||||
|
iter = typeElements.listIterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
OutputType type = (OutputType) iter.next();
|
||||||
|
if (type.isDirty()) return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Otherwise see if any options need saving
|
// Otherwise see if any options need saving
|
||||||
if (super.isDirty()) {
|
if (super.isDirty()) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue