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:
Thorbjørn Lindeijer
2010-03-22 14:58:41 +01:00
parent c6dfc92d95
commit 0981b1c7fc

View File

@@ -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 {