From 43405ae1ce9016151ac8087d1b3c86574e147350 Mon Sep 17 00:00:00 2001 From: Niels Weber Date: Wed, 18 Sep 2013 14:42:33 +0200 Subject: Add a comment to progress calculation. Change-Id: I16696eaec19a4563f647f4337a863b39868aed4d Reviewed-by: Tim Jenssen --- src/libs/installer/progresscoordinator.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/libs/installer/progresscoordinator.cpp') diff --git a/src/libs/installer/progresscoordinator.cpp b/src/libs/installer/progresscoordinator.cpp index 7d9a68e9f..7ba2b0912 100644 --- a/src/libs/installer/progresscoordinator.cpp +++ b/src/libs/installer/progresscoordinator.cpp @@ -137,9 +137,9 @@ void ProgressCoordinator::partProgressChanged(double fraction) newCurrentCompletePercentage = 100; } - if (qRound(m_currentCompletePercentage) < qRound(newCurrentCompletePercentage)) { + // In undo mode, the progress has to go backward, new has to be smaller than current + if (qRound(m_currentCompletePercentage) < qRound(newCurrentCompletePercentage)) qDebug("Something is wrong with the calculation of the progress."); - } m_currentCompletePercentage = newCurrentCompletePercentage; if (fraction == 1) { @@ -170,9 +170,10 @@ void ProgressCoordinator::partProgressChanged(double fraction) newCurrentCompletePercentage = 100; } - if (qRound(m_currentCompletePercentage) > qRound(newCurrentCompletePercentage)) { + // In normal mode, the progress has to go forward, new has to be larger than current + if (qRound(m_currentCompletePercentage) > qRound(newCurrentCompletePercentage)) qDebug("Something is wrong with the calculation of the progress."); - } + m_currentCompletePercentage = newCurrentCompletePercentage; if (fraction == 1 || fraction == 0) { -- cgit v1.2.3