1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Bug 368989: Supress initial index rebuild when automatic updates are turned off.

This commit is contained in:
Markus Schorn 2012-04-04 15:39:44 +02:00
parent e85390856a
commit ee20d322de

View file

@ -624,9 +624,10 @@ public class PDOMManager implements IWritableIndexManager, IListener {
registerIndexer(project, indexer); registerIndexer(project, indexer);
final IndexUpdatePolicy policy= createPolicy(project); final IndexUpdatePolicy policy= createPolicy(project);
policy.clearTUs(); policy.clearTUs();
policy.clearInitialFlags();
IPDOMIndexerTask task= null; IPDOMIndexerTask task= null;
if (policy.isAutomatic() || policy.isInitialRebuildRequested()) {
policy.clearInitialFlags();
if (operation.wasSuccessful()) { if (operation.wasSuccessful()) {
if (fTraceIndexerSetup) if (fTraceIndexerSetup)
System.out.println("Indexer: Imported shared index for project " + name); //$NON-NLS-1$ System.out.println("Indexer: Imported shared index for project " + name); //$NON-NLS-1$
@ -638,6 +639,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
task= new PDOMRebuildTask(indexer); task= new PDOMRebuildTask(indexer);
} }
enqueue(task); enqueue(task);
}
}} }}
} catch (CoreException e) { } catch (CoreException e) {
// Ignore if project is no longer open // Ignore if project is no longer open
@ -653,8 +655,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
IExtension indexerExt = Platform.getExtensionRegistry().getExtension(CCorePlugin.INDEXER_UNIQ_ID, indexerId); IExtension indexerExt = Platform.getExtensionRegistry().getExtension(CCorePlugin.INDEXER_UNIQ_ID, indexerId);
if (indexerExt != null) { if (indexerExt != null) {
IConfigurationElement[] elements = indexerExt.getConfigurationElements(); IConfigurationElement[] elements = indexerExt.getConfigurationElements();
for (int i = 0; i < elements.length; ++i) { for (IConfigurationElement element : elements) {
IConfigurationElement element = elements[i];
if ("run".equals(element.getName())) { //$NON-NLS-1$ if ("run".equals(element.getName())) { //$NON-NLS-1$
try { try {
indexer = (IPDOMIndexer) element.createExecutableExtension("class"); //$NON-NLS-1$ indexer = (IPDOMIndexer) element.createExecutableExtension("class"); //$NON-NLS-1$