mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
2005-03-23 Alain Magloire
Optimize the pathentry markers. * model/org/eclipse/cdt/internal/core/model/BinaryRunner.java * model/org/eclipse/cdt/internal/core/model/PathEntryManger.java
This commit is contained in:
parent
b7caba9dd2
commit
8da83b1029
3 changed files with 28 additions and 19 deletions
|
@ -1,3 +1,8 @@
|
|||
2005-03-23 Alain Magloire
|
||||
Optimize the pathentry markers.
|
||||
* model/org/eclipse/cdt/internal/core/model/BinaryRunner.java
|
||||
* model/org/eclipse/cdt/internal/core/model/PathEntryManger.java
|
||||
|
||||
2005-03-23 Vladimir Hirsl
|
||||
Moved ConsoleOutputSniffer from make.core plugin.
|
||||
Added minimal console parser interface.
|
||||
|
|
|
@ -87,7 +87,7 @@ public class BinaryRunner {
|
|||
}
|
||||
}
|
||||
|
||||
void fireEvents(ICProject cproject, Parent container) {
|
||||
void fireEvents(ICProject cproj, Parent container) {
|
||||
// Fired the event.
|
||||
try {
|
||||
ICElement[] children = container.getChildren();
|
||||
|
@ -95,7 +95,7 @@ public class BinaryRunner {
|
|||
CModelManager factory = CModelManager.getDefault();
|
||||
ICElement root = factory.getCModel();
|
||||
CElementDelta cdelta = new CElementDelta(root);
|
||||
cdelta.added(cproject);
|
||||
cdelta.added(cproj);
|
||||
cdelta.added(container);
|
||||
for (int i = 0; i < children.length; i++) {
|
||||
cdelta.added(children[i]);
|
||||
|
|
|
@ -71,6 +71,7 @@ import org.eclipse.core.runtime.Path;
|
|||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Plugin;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
|
||||
/**
|
||||
|
@ -1176,7 +1177,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
|
||||
*/
|
||||
public void run(IProgressMonitor monitor) throws CoreException {
|
||||
public void run(IProgressMonitor mon) throws CoreException {
|
||||
flushPathEntryProblemMarkers(project);
|
||||
for (int i = 0; i < problems.length; ++i) {
|
||||
createPathEntryProblemMarker(project, problems[i]);
|
||||
|
@ -1190,7 +1191,8 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
|||
return Status.OK_STATUS;
|
||||
}
|
||||
};
|
||||
markerTask.setRule(CCorePlugin.getWorkspace().getRoot());
|
||||
ISchedulingRule rule = project.getWorkspace().getRuleFactory().markerRule(project);
|
||||
markerTask.setRule(rule);
|
||||
markerTask.schedule();
|
||||
}
|
||||
|
||||
|
@ -1457,13 +1459,12 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
|||
IPathEntry[] entries = getCachedResolvedPathEntries(cProjects[i]);
|
||||
if (entries != null) {
|
||||
IProject project = cProjects[i].getProject();
|
||||
try {
|
||||
IMarker[] markers = project.findMarkers(ICModelMarker.PATHENTRY_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
|
||||
if (markers != null && markers.length > 0) {
|
||||
ArrayList problemList = new ArrayList();
|
||||
ICModelStatus status = validatePathEntry(cProjects[i], entries);
|
||||
if (!status.isOK()) {
|
||||
problemList.add(status);
|
||||
}
|
||||
for (int j = 0; j < entries.length; j++) {
|
||||
status = validatePathEntry(cProjects[i], entries[j], true, false);
|
||||
ICModelStatus status = validatePathEntry(cProjects[i], entries[j], true, false);
|
||||
if (!status.isOK()) {
|
||||
problemList.add(status);
|
||||
}
|
||||
|
@ -1474,6 +1475,10 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
|||
generateMarkers(project, problems);
|
||||
}
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
// ignore the exception.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (CModelException e) {
|
||||
|
@ -1864,7 +1869,6 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
|||
protected IMarker[] getPathEntryProblemMarkers(IProject project) {
|
||||
|
||||
try {
|
||||
IWorkspace workspace = project.getWorkspace();
|
||||
IMarker[] markers = project.findMarkers(ICModelMarker.PATHENTRY_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
|
||||
if (markers != null) {
|
||||
return markers;
|
||||
|
|
Loading…
Add table
Reference in a new issue