From 7474a5d8c19faf2319fde4ac50b058da859a07c2 Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Sun, 27 Dec 2009 23:21:34 +0000 Subject: [PATCH] bug 298552: Two cases of neglect refreshing resource settings in Project Explorer --- .../cdt/ui/CElementContentProvider.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementContentProvider.java index dc81e6a1f2a..f3671734d0c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementContentProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementContentProvider.java @@ -32,6 +32,7 @@ import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.ElementChangedEvent; import org.eclipse.cdt.core.model.IArchive; import org.eclipse.cdt.core.model.IBinary; +import org.eclipse.cdt.core.model.ICContainer; import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.ICElementDelta; import org.eclipse.cdt.core.model.ICModel; @@ -171,7 +172,7 @@ public class CElementContentProvider extends BaseCElementContentProvider impleme } // We do not care about changes in Working copies - // well, we do see bugzilla 147694 + // well, we do see bug 147694 if (element instanceof ITranslationUnit) { ITranslationUnit unit = (ITranslationUnit) element; if (unit.isWorkingCopy()) { @@ -196,10 +197,15 @@ public class CElementContentProvider extends BaseCElementContentProvider impleme updateContainer(element); } + if (isPathEntryChange(delta)) { + postRefresh(element.getCProject()); + return; + } + if (kind == ICElementDelta.CHANGED) { // Binary/Archive changes is done differently since they // are at two places, they are in the {Binary,Archive}Container - // and in the Tree hiearchy + // and in the Tree hierarchy if (updateContainer(element)) { Object parent = getParent(element); postRefresh(parent); @@ -207,18 +213,17 @@ public class CElementContentProvider extends BaseCElementContentProvider impleme } else if (element instanceof ITranslationUnit) { postRefresh(element); return; + } else if (element instanceof ICContainer) { + // if element itself has changed, not its children + if ((flags&~(ICElementDelta.F_CHILDREN|ICElementDelta.F_FINE_GRAINED))!=0) { + postRefresh(element); + } } else if (element instanceof ArchiveContainer || element instanceof BinaryContainer) { postContainerRefresh((IParent) element, element.getCProject()); } } - if (isPathEntryChange(delta)) { - // throw the towel and do a full refresh of the affected C project. - postRefresh(element.getCProject()); - return;// bailout - } - if (processResourceDeltas(delta.getResourceDeltas(), element)) return;