summaryrefslogtreecommitdiffstats
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2009-06-15 20:37:55 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2009-06-15 20:37:55 +0000
commitc038ab47108527b61935d0a243bbff189c11de70 (patch)
treebe90e56726027164b52137a01a4e39b6611e7bb3 /rbutil
parent9c19e39a40a8f424ac5c53ca1820550c54657a7b (diff)
downloadrockbox-c038ab47108527b61935d0a243bbff189c11de70.tar.gz
rockbox-c038ab47108527b61935d0a243bbff189c11de70.tar.bz2
rockbox-c038ab47108527b61935d0a243bbff189c11de70.zip
Set the maximum first when updating the progresslogger progress bar as otherwise the new value will get dropped if outside of the valid range. Fixes the progress showing 0% after downloading the manual.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21302 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutilqt/progressloggergui.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/rbutil/rbutilqt/progressloggergui.cpp b/rbutil/rbutilqt/progressloggergui.cpp
index 0358d75096..a6405a9619 100644
--- a/rbutil/rbutilqt/progressloggergui.cpp
+++ b/rbutil/rbutilqt/progressloggergui.cpp
@@ -61,8 +61,11 @@ void ProgressLoggerGui::addItem(const QString &text, int flag)
void ProgressLoggerGui::setProgress(int value, int max)
{
- setProgressValue(value);
+ // set maximum first to avoid setting a value outside of the max range.
+ // If the current value is outside of the valid range QProgressBar
+ // calls reset() internally.
setProgressMax(max);
+ setProgressValue(value);
}