From f4ecd611376e7cc5a2d40f0bfee3adf2563c5d10 Mon Sep 17 00:00:00 2001 From: Leo Treggiari Date: Mon, 4 Jul 2005 22:51:47 +0000 Subject: [PATCH] Fix *Dirty to account for new children --- .../internal/core/InputType.java | 26 +++++++++++++++++++ .../managedbuilder/internal/core/Tool.java | 14 ++++++++++ 2 files changed, 40 insertions(+) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java index 4f983a82687..b61a154b890 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java @@ -1105,6 +1105,19 @@ public class InputType extends BuildObject implements IInputType { public boolean isDirty() { // This shouldn't be called for an extension InputType 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; } @@ -1113,6 +1126,19 @@ public class InputType extends BuildObject implements IInputType { */ public void setDirty(boolean 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) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java index 7362f8e011a..d8f9df51020 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java @@ -2265,6 +2265,20 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory { // If I need saving, just say yes 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 if (super.isDirty()) { return true;