mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 08:46:02 +02:00
Bug 368989: Supress initial index rebuild when automatic updates are turned off.
This commit is contained in:
parent
e85390856a
commit
ee20d322de
1 changed files with 14 additions and 13 deletions
|
@ -624,20 +624,22 @@ 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 (operation.wasSuccessful()) {
|
if (policy.isAutomatic() || policy.isInitialRebuildRequested()) {
|
||||||
if (fTraceIndexerSetup)
|
policy.clearInitialFlags();
|
||||||
System.out.println("Indexer: Imported shared index for project " + name); //$NON-NLS-1$
|
if (operation.wasSuccessful()) {
|
||||||
task= new PDOMUpdateTask(indexer,
|
if (fTraceIndexerSetup)
|
||||||
IIndexManager.UPDATE_CHECK_TIMESTAMPS | IIndexManager.UPDATE_CHECK_CONTENTS_HASH);
|
System.out.println("Indexer: Imported shared index for project " + name); //$NON-NLS-1$
|
||||||
} else {
|
task= new PDOMUpdateTask(indexer,
|
||||||
if (fTraceIndexerSetup)
|
IIndexManager.UPDATE_CHECK_TIMESTAMPS | IIndexManager.UPDATE_CHECK_CONTENTS_HASH);
|
||||||
System.out.println("Indexer: Rebuiding for project " + name); //$NON-NLS-1$
|
} else {
|
||||||
task= new PDOMRebuildTask(indexer);
|
if (fTraceIndexerSetup)
|
||||||
|
System.out.println("Indexer: Rebuiding for project " + name); //$NON-NLS-1$
|
||||||
|
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$
|
||||||
|
|
Loading…
Add table
Reference in a new issue