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:
parent
f3db89773b
commit
e22d8fbc58
2 changed files with 21 additions and 9 deletions
|
@ -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(){
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue