mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-27 03:29:12 +02:00
Opkman: Limit the update of the progressbar to 1 second.
git-svn-id: trunk@63720 -
This commit is contained in:
parent
a5841ef7d9
commit
9cdb326ff0
@ -92,6 +92,7 @@ type
|
||||
FSpeed: Integer;
|
||||
FStartTime: QWord;
|
||||
FElapsed: QWord;
|
||||
FTick: Qword;
|
||||
FNeedToBreak: Boolean;
|
||||
FDownloadTo: String;
|
||||
FUPackageName: String;
|
||||
@ -295,7 +296,11 @@ begin
|
||||
FSpeed := Round(FTotPosTmp/FElapsed);
|
||||
if FSpeed > 0 then
|
||||
FRemaining := Round((FTotSize - FTotPosTmp)/FSpeed);
|
||||
Synchronize(@DoOnPackageDownloadProgress);
|
||||
if FElapsed >= FTick + 1 then
|
||||
begin
|
||||
FTick := FElapsed;
|
||||
Synchronize(@DoOnPackageDownloadProgress);
|
||||
end;
|
||||
Sleep(5);
|
||||
end;
|
||||
|
||||
@ -309,7 +314,7 @@ begin
|
||||
Sleep(50);
|
||||
FErrMsg := '';
|
||||
FErrTyp := etNone;
|
||||
if FDownloadType = dtJSON then //JSON
|
||||
if FDownloadType = dtJSON then
|
||||
begin
|
||||
if not FNeedToBreak then
|
||||
Synchronize(@DoOnJSONProgress);
|
||||
|
Loading…
Reference in New Issue
Block a user