mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
This commit is contained in:
parent
a3995849f5
commit
a9691ef057
1 changed files with 19 additions and 5 deletions
|
@ -105,7 +105,6 @@ public class DiscoveryOptionsBlock extends AbstractCOptionPage {
|
|||
private String initialBuilderParserId = null;
|
||||
private Map providerParsers = new HashMap();
|
||||
private String initialProviderParserId = null;
|
||||
private boolean fCreatePathContainer = false;
|
||||
|
||||
public DiscoveryOptionsBlock() {
|
||||
super(MakeUIPlugin.getResourceString(DIALOG_TITLE));
|
||||
|
@ -131,7 +130,6 @@ public class DiscoveryOptionsBlock extends AbstractCOptionPage {
|
|||
fInitialized = false;
|
||||
fBuildInfo = MakeCorePlugin.createScannerConfigBuildInfo(fPrefs, ScannerConfigBuilder.BUILDER_ID, true);
|
||||
}
|
||||
fCreatePathContainer = true;
|
||||
} else {
|
||||
fBuildInfo = MakeCorePlugin.createScannerConfigBuildInfo(fPrefs, ScannerConfigBuilder.BUILDER_ID, false);
|
||||
}
|
||||
|
@ -159,11 +157,13 @@ public class DiscoveryOptionsBlock extends AbstractCOptionPage {
|
|||
IProject project = getContainer().getProject();
|
||||
if (project != null) {
|
||||
buildInfo = MakeCorePlugin.createScannerConfigBuildInfo(project, ScannerConfigBuilder.BUILDER_ID);
|
||||
if (fCreatePathContainer) {
|
||||
if (isScannerConfigDiscoveryEnabled()) {
|
||||
createDiscoveredPathContainer(project);
|
||||
// create a new discovered scanner config store
|
||||
MakeCorePlugin.getDefault().getDiscoveryManager().removeDiscoveredInfo(project);
|
||||
} else {
|
||||
removeDiscoveredPathContainer(project);
|
||||
}
|
||||
// create a new discovered scanner config store
|
||||
MakeCorePlugin.getDefault().getDiscoveryManager().removeDiscoveredInfo(project);
|
||||
} else {
|
||||
buildInfo = MakeCorePlugin.createScannerConfigBuildInfo(fPrefs, ScannerConfigBuilder.BUILDER_ID, false);
|
||||
}
|
||||
|
@ -209,6 +209,20 @@ public class DiscoveryOptionsBlock extends AbstractCOptionPage {
|
|||
}
|
||||
}
|
||||
|
||||
private void removeDiscoveredPathContainer(IProject project) throws CModelException {
|
||||
IPathEntry container = CoreModel.newContainerEntry(DiscoveredPathContainer.CONTAINER_ID);
|
||||
ICProject cProject = CoreModel.getDefault().create(project);
|
||||
if (cProject != null) {
|
||||
IPathEntry[] entries = cProject.getRawPathEntries();
|
||||
List newEntries = new ArrayList(Arrays.asList(entries));
|
||||
if (newEntries.contains(container)) {
|
||||
newEntries.remove(container);
|
||||
cProject.setRawPathEntries((IPathEntry[])newEntries.toArray(new IPathEntry[newEntries.size()]),
|
||||
new NullProgressMonitor());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue