From 67a14a172e883cbcb21a605aea46ff1ad1e0b549 Mon Sep 17 00:00:00 2001
From: con <qtc-committer@nokia.com>
Date: Fri, 5 Mar 2010 13:49:27 +0100
Subject: [PATCH] Sometimes the progress bar would show a 50% green bar in the
 beginning.

QtConcurrent seems to sometimes take some time before the
progress information is initialized. This change fixes the appearance
for that case.
---
 src/plugins/coreplugin/progressmanager/progressbar.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/plugins/coreplugin/progressmanager/progressbar.cpp b/src/plugins/coreplugin/progressmanager/progressbar.cpp
index fc4a2189027..c272c5f47e9 100644
--- a/src/plugins/coreplugin/progressmanager/progressbar.cpp
+++ b/src/plugins/coreplugin/progressmanager/progressbar.cpp
@@ -134,7 +134,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
         bar.load(QLatin1String(":/core/images/progressbar.png"));
 
     double range = maximum() - minimum();
-    double percent = 0.50;
+    double percent = 0.;
     if (range != 0)
         percent = (value() - minimum()) / range;
     if (percent > 1)
@@ -195,7 +195,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
         // avoid too small red bar
         if (inner.width() < 10)
             inner.adjust(0, 0, 10 - inner.width(), 0);
-    } else if (value() == maximum()) {
+    } else if (value() == maximum() && range != 0) {
         c = QColor(90, 170, 60);
     }
 
-- 
GitLab