1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 14:55:41 +02:00

show name of current index job in the progress view

This commit is contained in:
Andrew Niefer 2004-05-14 20:26:40 +00:00
parent f3db89773b
commit e22d8fbc58
2 changed files with 21 additions and 9 deletions

View file

@ -58,7 +58,7 @@ public class IndexingJob extends Job {
ticks++;
if( ticks > maxTicks )
maxTicks = ticks;
updateRemainingCount();
updateRemainingCount( "" );
}
public void setTicks( int n ){
@ -67,10 +67,10 @@ public class IndexingJob extends Job {
maxTicks = ticks;
updatePercentage();
updateRemainingCount();
updateRemainingCount( "" );
}
public int tickDown(){
public int tickDown( String str ){
if( progressMonitor != null && progressMonitor.isCanceled() ){
jobManager.pause();
return 0;
@ -78,15 +78,17 @@ public class IndexingJob extends Job {
ticks--;
updatePercentage();
updateRemainingCount();
updateRemainingCount( str );
return ticks;
}
private void updateRemainingCount(){
private void updateRemainingCount( String str ){
if( progressMonitor == null )
return;
progressMonitor.subTask( Util.bind("manager.filesToIndex", Integer.toString(ticks)) );
String taskString = Util.bind("manager.filesToIndex", Integer.toString(ticks));
taskString += str;
progressMonitor.subTask( taskString );
}
private void updatePercentage(){

View file

@ -17,6 +17,7 @@ import java.util.HashSet;
import org.eclipse.cdt.core.ICLogConstants;
import org.eclipse.cdt.internal.core.Util;
import org.eclipse.cdt.internal.core.search.indexing.IndexRequest;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
@ -189,9 +190,18 @@ public abstract class JobManager implements Runnable {
jobEnd = -1;
}
}
if( indexJob != null && indexJob.tickDown() == 0 ){
indexJob.done( OK_STATUS );
indexJob = null;
if( indexJob != null ){
String progressString = null;
IJob job = currentJob();
if( job instanceof IndexRequest ){
progressString = " (";
progressString += job.toString();
progressString += ")";
}
if( indexJob.tickDown( progressString ) == 0 ){
indexJob.done( OK_STATUS );
indexJob = null;
}
}
}
/**