diff options
author | Niels Weber <niels.weber@digia.com> | 2013-09-18 14:42:33 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@digia.com> | 2013-09-18 16:08:39 +0200 |
commit | 43405ae1ce9016151ac8087d1b3c86574e147350 (patch) | |
tree | 58d652a53e874bacb2bb9d9bf7671acc6e988524 /src | |
parent | c9cbd301b19f0b72a918d1b1ee66adf5fdb53bec (diff) |
Add a comment to progress calculation.
Change-Id: I16696eaec19a4563f647f4337a863b39868aed4d
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/installer/progresscoordinator.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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) { |