# HG changeset patch # User dadubrow # Date 1251127044 18000 # Node ID 689d22da9f189666373f3dd9c425b532d599f149 # Parent 30678d98b2005e268f492d226a82c7240b729520 Bug 9513 - fix delta traversal for nested source roots + remove previous fix in CModelManager diff -r 30678d98b200 -r 689d22da9f18 cdt/cdt_6_0_x/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java --- a/cdt/cdt_6_0_x/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java Thu Aug 20 15:14:59 2009 -0500 +++ b/cdt/cdt_6_0_x/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java Mon Aug 24 10:17:24 2009 -0500 @@ -269,7 +269,7 @@ for (int i = 0; i < children.length; ++i) { if (children[i] instanceof ISourceRoot) { ISourceRoot root = (ISourceRoot)children[i]; - if (root.isOnSourceEntry(folder) || isParentOfSourceRoot(root, folder)) { + if (root.isOnSourceEntry(folder)) { // Get the container IPath path = folder.getFullPath(); path = path.removeFirstSegments(root.getPath().segmentCount()); @@ -1277,19 +1277,4 @@ CCoreInternals.getPDOMManager().preCloseProject(create(project)); } - /** - * For nested source roots, checks whether or not a source root is a parent of a given folder - * @param root - The source root to check against - * @param folder - Folder to check whether or not the given root is a child - * @return true is the IFolder is a parent of the ISourceRoot - */ - public boolean isParentOfSourceRoot(ISourceRoot root, IFolder folder) { - if (CCorePlugin.showSourceRootsAtTopOfProject()){ - // not nested source roots so no need to check - return false; - } - - return folder.getFullPath().isPrefixOf(root.getPath()); - } - } diff -r 30678d98b200 -r 689d22da9f18 cdt/cdt_6_0_x/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java --- a/cdt/cdt_6_0_x/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java Thu Aug 20 15:14:59 2009 -0500 +++ b/cdt/cdt_6_0_x/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java Mon Aug 24 10:17:24 2009 -0500 @@ -457,11 +457,11 @@ ICElement current = createElement(resource); updateChildren = updateCurrentDeltaAndIndex(current, delta); if (current == null) { - nonCResourcesChanged(parent, delta); - // no corresponding ICElement - we are done - return; + if (parent != null) + nonCResourcesChanged(parent, delta); } else if (current instanceof ISourceRoot) { - nonCResourcesChanged(parent, delta); + if (parent != null) + nonCResourcesChanged(parent, delta); } else if (current instanceof ICProject) { ICProject cprj = (ICProject)current; CModel cModel = CModelManager.getDefault().getCModel();