Bug 9513 - fix delta traversal for nested source roots + remove previous fix in CModelManager
authordadubrow
Mon, 24 Aug 2009 10:17:24 -0500
changeset 75 689d22da9f18
parent 74 30678d98b200
child 76 458fc5858693
child 77 2d52d49686f6
child 79 a8a65e3a49a8
Bug 9513 - fix delta traversal for nested source roots + remove previous fix in CModelManager
cdt/cdt_6_0_x/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java
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/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());
-	}
-
 }
--- 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();