From c038ab47108527b61935d0a243bbff189c11de70 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Mon, 15 Jun 2009 20:37:55 +0000 Subject: 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 --- rbutil/rbutilqt/progressloggergui.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.3