forked from qt-creator/qt-creator
Report finished state for concurrent jobs that don't support progress
Some concurrent jobs, like getting 'git blame' output, do not report progress. Their the minimum and maximum of their progress range is always 0, but they do report when they are finished. When such a job finishes, we should make sure the progress bar indicates this. Reviewed-by: con
This commit is contained in:
@@ -197,6 +197,13 @@ bool FutureProgress::eventFilter(QObject *, QEvent *e)
|
||||
void FutureProgress::setFinished()
|
||||
{
|
||||
updateToolTip(m_watcher.future().progressText());
|
||||
|
||||
// Special case for concurrent jobs that don't use QFutureInterface to report progress
|
||||
if (m_watcher.progressMinimum() == 0 && m_watcher.progressMaximum() == 0) {
|
||||
m_progress->setRange(0, 1);
|
||||
m_progress->setValue(1);
|
||||
}
|
||||
|
||||
if (m_watcher.future().isCanceled()) {
|
||||
m_progress->setError(true);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user