From 0981b1c7fc1fd5d35e321785a1bfa7ccc7ef0126 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com>
Date: Mon, 22 Mar 2010 14:58:41 +0100
Subject: [PATCH] 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
---
 src/plugins/coreplugin/progressmanager/futureprogress.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/plugins/coreplugin/progressmanager/futureprogress.cpp b/src/plugins/coreplugin/progressmanager/futureprogress.cpp
index aaa56fcb0a1..f2aed6c6cb4 100644
--- a/src/plugins/coreplugin/progressmanager/futureprogress.cpp
+++ b/src/plugins/coreplugin/progressmanager/futureprogress.cpp
@@ -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 {
-- 
GitLab