[vcs-log] do not check for registry in VcsLogProgress (never use status bar progress)

This commit is contained in:
Julia Beliaeva
2016-06-22 00:56:01 +03:00
parent 33a7133fd2
commit ba207dd7d0
4 changed files with 5 additions and 17 deletions
@@ -235,7 +235,7 @@ public class VcsLogData implements Disposable, VcsLogDataProvider {
}
}
};
myDataLoaderQueue.run(backgroundable, null, myRefresher.getProgress().createProgressIndicator(backgroundable));
myDataLoaderQueue.run(backgroundable, null, myRefresher.getProgress().createProgressIndicator());
}
/**
@@ -67,7 +67,7 @@ public class VcsLogFiltererImpl implements VcsLogFilterer {
UIUtil.invokeLaterIfNeeded(() -> {
MyTask task = new MyTask(project, "Applying filters...");
ProgressManager.getInstance().runProcessWithProgressAsynchronously(task,
myLogData.getProgress().createProgressIndicator(task));
myLogData.getProgress().createProgressIndicator());
});
}
};
@@ -19,11 +19,8 @@ import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.progress.EmptyProgressIndicator;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.Task;
import com.intellij.openapi.progress.impl.BackgroundableProcessIndicator;
import com.intellij.openapi.progress.util.AbstractProgressIndicatorBase;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -37,16 +34,11 @@ public class VcsLogProgress {
private int myRunningTasksCount = 0;
@NotNull
public ProgressIndicator createProgressIndicator(@NotNull Task.Backgroundable task) {
public ProgressIndicator createProgressIndicator() {
if (ApplicationManager.getApplication().isHeadlessEnvironment()) {
return new EmptyProgressIndicator();
}
else if (showProgressInLog()) {
return new VcsLogProgressIndicator();
}
else {
return new BackgroundableProcessIndicator(task);
}
return new VcsLogProgressIndicator();
}
public void addProgressIndicatorListener(@NotNull ProgressListener listener, @Nullable Disposable parentDisposable) {
@@ -92,10 +84,6 @@ public class VcsLogProgress {
}
}
public boolean showProgressInLog() {
return Registry.is("vcs.log.keep.up.to.date");
}
private class VcsLogProgressIndicator extends AbstractProgressIndicatorBase {
@Override
public synchronized void start() {
@@ -88,7 +88,7 @@ public class VcsLogRefresherImpl implements VcsLogRefresher {
protected void startNewBackgroundTask(@NotNull final Task.Backgroundable refreshTask) {
UIUtil.invokeLaterIfNeeded(() -> {
LOG.debug("Starting a background task...");
ProgressManager.getInstance().runProcessWithProgressAsynchronously(refreshTask, myProgress.createProgressIndicator(refreshTask));
ProgressManager.getInstance().runProcessWithProgressAsynchronously(refreshTask, myProgress.createProgressIndicator());
});
}