mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
a48e822d59
commit
9883a156f5
3 changed files with 22 additions and 28 deletions
|
@ -6,9 +6,8 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Markus Schorn - initial API and implementation
|
||||
* Markus Schorn - initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.internal.core.index;
|
||||
|
||||
import org.eclipse.cdt.core.index.IIndexManager;
|
||||
|
@ -16,7 +15,6 @@ import org.eclipse.cdt.core.model.ICProject;
|
|||
import org.eclipse.core.runtime.CoreException;
|
||||
|
||||
public interface IWritableIndexManager extends IIndexManager {
|
||||
|
||||
/**
|
||||
* Returns a writable index or <code>null</code> if the project does not exist or is not yet
|
||||
* registered with the pdom manager.
|
||||
|
|
|
@ -6,18 +6,16 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Markus Schorn - initial API and implementation
|
||||
* Markus Schorn - initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.internal.core.pdom;
|
||||
|
||||
public class IndexerProgress {
|
||||
|
||||
public int fRequestedFilesCount;
|
||||
public int fCompletedSources;
|
||||
public int fPrimaryHeaderCount; // headers parsed that were actually requested
|
||||
public int fCompletedHeaders; // all headers including those found through inclusions
|
||||
public int fTimeEstimate; // fall-back for the time where no file-count is available
|
||||
public int fPrimaryHeaderCount; // Headers parsed that were actually requested
|
||||
public int fCompletedHeaders; // All headers including those found through inclusions
|
||||
public int fTimeEstimate; // Fall-back for the time where no file-count is available
|
||||
|
||||
public IndexerProgress() {
|
||||
}
|
||||
|
|
|
@ -111,9 +111,7 @@ import org.eclipse.core.runtime.preferences.InstanceScope;
|
|||
import com.ibm.icu.text.MessageFormat;
|
||||
|
||||
/**
|
||||
* The PDOM Provider. This is likely temporary since I hope
|
||||
* to integrate the PDOM directly into the core once it has
|
||||
* stabilized.
|
||||
* Manages PDOM updates and events associated with them. Provides methods for index access.
|
||||
*/
|
||||
public class PDOMManager implements IWritableIndexManager, IListener {
|
||||
private static final String TRACE_INDEXER_SETUP = CCorePlugin.PLUGIN_ID + "/debug/indexer/setup"; //$NON-NLS-1$
|
||||
|
@ -697,10 +695,10 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
|||
} else {
|
||||
if (fCurrentTask != null) {
|
||||
IndexerProgress info= fCurrentTask.getProgressInformation();
|
||||
fSourceCount+= info.fCompletedSources;
|
||||
fHeaderCount+= info.fCompletedHeaders;
|
||||
fSourceCount += info.fCompletedSources;
|
||||
fHeaderCount += info.fCompletedHeaders;
|
||||
// for the ticks we don't consider additional headers
|
||||
fTickCount+= info.fCompletedSources + info.fPrimaryHeaderCount;
|
||||
fTickCount += info.fCompletedSources + info.fPrimaryHeaderCount;
|
||||
}
|
||||
result= fCurrentTask= fTaskQueue.removeFirst();
|
||||
}
|
||||
|
@ -1138,26 +1136,26 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
|||
int sourceCount, sourceEstimate, headerCount, tickCount, tickEstimate;
|
||||
String detail= null;
|
||||
synchronized (fTaskQueue) {
|
||||
// add historic data
|
||||
// Add historic data.
|
||||
sourceCount= sourceEstimate= fSourceCount;
|
||||
headerCount= fHeaderCount;
|
||||
tickCount= tickEstimate= fTickCount;
|
||||
|
||||
// add future data
|
||||
// Add future data.
|
||||
for (IPDOMIndexerTask task : fTaskQueue) {
|
||||
final IndexerProgress info= task.getProgressInformation();
|
||||
sourceEstimate+= info.fRequestedFilesCount;
|
||||
tickEstimate+= info.getEstimatedTicks();
|
||||
sourceEstimate += info.fRequestedFilesCount;
|
||||
tickEstimate += info.getEstimatedTicks();
|
||||
}
|
||||
// add current data
|
||||
// Add current data.
|
||||
if (fCurrentTask != null) {
|
||||
final IndexerProgress info= fCurrentTask.getProgressInformation();
|
||||
sourceCount+= info.fCompletedSources;
|
||||
sourceEstimate+= info.fRequestedFilesCount - info.fPrimaryHeaderCount;
|
||||
headerCount+= info.fCompletedHeaders;
|
||||
// for the ticks we don't consider additional headers
|
||||
tickCount+= info.fCompletedSources + info.fPrimaryHeaderCount;
|
||||
tickEstimate+= info.getEstimatedTicks();
|
||||
sourceCount += info.fCompletedSources;
|
||||
sourceEstimate += info.fRequestedFilesCount - info.fPrimaryHeaderCount;
|
||||
headerCount += info.fCompletedHeaders;
|
||||
// For the ticks we don't consider additional headers.
|
||||
tickCount += info.fCompletedSources + info.fPrimaryHeaderCount;
|
||||
tickEstimate += info.getEstimatedTicks();
|
||||
detail= PDOMIndexerJob.sMonitorDetail;
|
||||
}
|
||||
}
|
||||
|
@ -1171,9 +1169,9 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
|||
|
||||
job.subTask(msg);
|
||||
if (tickCount > 0 && tickCount <= tickEstimate) {
|
||||
int newTick= tickCount*base/tickEstimate;
|
||||
int newTick= tickCount * base / tickEstimate;
|
||||
if (newTick > currentTicks) {
|
||||
job.worked(newTick-currentTicks);
|
||||
job.worked(newTick - currentTicks);
|
||||
return newTick;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue