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++;
|
ticks++;
|
||||||
if( ticks > maxTicks )
|
if( ticks > maxTicks )
|
||||||
maxTicks = ticks;
|
maxTicks = ticks;
|
||||||
updateRemainingCount();
|
updateRemainingCount( "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTicks( int n ){
|
public void setTicks( int n ){
|
||||||
|
@ -67,10 +67,10 @@ public class IndexingJob extends Job {
|
||||||
maxTicks = ticks;
|
maxTicks = ticks;
|
||||||
|
|
||||||
updatePercentage();
|
updatePercentage();
|
||||||
updateRemainingCount();
|
updateRemainingCount( "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
public int tickDown(){
|
public int tickDown( String str ){
|
||||||
if( progressMonitor != null && progressMonitor.isCanceled() ){
|
if( progressMonitor != null && progressMonitor.isCanceled() ){
|
||||||
jobManager.pause();
|
jobManager.pause();
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -78,15 +78,17 @@ public class IndexingJob extends Job {
|
||||||
ticks--;
|
ticks--;
|
||||||
|
|
||||||
updatePercentage();
|
updatePercentage();
|
||||||
updateRemainingCount();
|
updateRemainingCount( str );
|
||||||
return ticks;
|
return ticks;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateRemainingCount(){
|
private void updateRemainingCount( String str ){
|
||||||
if( progressMonitor == null )
|
if( progressMonitor == null )
|
||||||
return;
|
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(){
|
private void updatePercentage(){
|
||||||
|
|
|
@ -17,6 +17,7 @@ import java.util.HashSet;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.ICLogConstants;
|
import org.eclipse.cdt.core.ICLogConstants;
|
||||||
import org.eclipse.cdt.internal.core.Util;
|
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.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.OperationCanceledException;
|
import org.eclipse.core.runtime.OperationCanceledException;
|
||||||
|
@ -189,9 +190,18 @@ public abstract class JobManager implements Runnable {
|
||||||
jobEnd = -1;
|
jobEnd = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( indexJob != null && indexJob.tickDown() == 0 ){
|
if( indexJob != null ){
|
||||||
indexJob.done( OK_STATUS );
|
String progressString = null;
|
||||||
indexJob = 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