From a0140348f1fae784b06290f5392bfcbb0da547a6 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 3 Jul 2007 17:56:59 +0000 Subject: [PATCH] bug 194395: excluded folders doubled in project view https://bugs.eclipse.org/bugs/show_bug.cgi?id=194395 For excluded folders at the project root that were output folders, both the SourceRoot and the CProject were adding the folder to the Projects view. Now, for CProject, we check to see if we are also a SourceRoot and if so, we don't add in the folder. --- .../org/eclipse/cdt/internal/core/model/CProject.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java index d8d2a6b173c..bf32bd91a41 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java @@ -625,6 +625,13 @@ public class CProject extends Openable implements ICProject { List children = new ArrayList(sourceRoots.size()); children.addAll(sourceRoots); + boolean projectIsSourceRoot = false; + for (Iterator i = sourceRoots.iterator(); i.hasNext();) + if (((ISourceRoot)i.next()).getResource().equals(getProject())) { + projectIsSourceRoot = true; + break; + } + // Now look for output folders try { IResource[] resources = getProject().members(); @@ -641,7 +648,9 @@ public class CProject extends Openable implements ICProject { } // Not in source folder, check if it's a container on output entry - if (!found && isOnOutputEntry(child)) + // Also make sure I'm not a source root since my SourceRoot object would + // have already added this. + if (!found && isOnOutputEntry(child) && !projectIsSourceRoot) children.add(new CContainer(this, child)); } }