mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 01:36:01 +02:00
Follow up fix for 202093, compare projects directly.
This commit is contained in:
parent
fc2132103b
commit
eacf4ace70
1 changed files with 4 additions and 11 deletions
|
@ -27,7 +27,6 @@ import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,16 +120,10 @@ public class GCCPerFileBOPConsoleParser extends AbstractGCCBOPConsoleParser {
|
||||||
IPath baseDirectory = fUtil.getBaseDirectory();
|
IPath baseDirectory = fUtil.getBaseDirectory();
|
||||||
boolean isValidPath = baseDirectory.isPrefixOf(pFilePath);
|
boolean isValidPath = baseDirectory.isPrefixOf(pFilePath);
|
||||||
if (!isValidPath) {
|
if (!isValidPath) {
|
||||||
IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
|
final IProject prj= fUtil.getProject();
|
||||||
IFile[] foundOccurrences = wsRoot.findFilesForLocation(pFilePath);
|
IFile[] foundOccurrences = ((IWorkspaceRoot) prj.getParent()).findFilesForLocation(pFilePath);
|
||||||
if (foundOccurrences != null) {
|
for (int j=0; !isValidPath && j<foundOccurrences.length; j++) {
|
||||||
for (int j=0; j<foundOccurrences.length; j++) {
|
isValidPath= prj.equals(foundOccurrences[j].getProject());
|
||||||
IProject foundProject = foundOccurrences[j].getProject();
|
|
||||||
if (foundProject != null && foundProject.getLocation().equals(baseDirectory)) {
|
|
||||||
isValidPath = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isValidPath) {
|
if (isValidPath) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue