Skip to content
Permalink
Browse files

Cheat when calculating percentage of done work, when exporting tables…

… and data, so we never get more than 100%. Closes #180
  • Loading branch information...
ansgarbecker committed Apr 17, 2019
1 parent b64b8bf commit 91c8ff13f0f25a17a0e757a749c7370ae027898e
Showing with 2 additions and 0 deletions.
  1. +2 −0 source/tabletools.pas
@@ -1073,6 +1073,7 @@ procedure TfrmTableTools.UpdateResultGrid;
ResultGrid.FocusedNode := ResultGrid.GetLast;
ResultGrid.Selected[ResultGrid.FocusedNode] := True;
Percent := 100 / Max(FObjectSizes,1) * FObjectSizesDoneExact;
Percent := Min(Percent, 100);
lblCheckedSize.Caption := f_('Selected objects size: %s', [FormatByteNumber(FObjectSizes)]) + '. ' +
f_('%s%% done', [FormatNumber(Percent, 1)]) + '.';
MainForm.SetProgressPosition(Round(Percent));
@@ -1400,6 +1401,7 @@ procedure TfrmTableTools.DoExport(DBObj: TDBObject);
begin
LogRow := FResults.Last;
Percent := 100 / Max(DBObj.Rows,1) * Max(RowsDone,1);
Percent := Min(Percent, 100);
BytesDone := Max(DBObj.Size,0) div Max(DBObj.Rows,1) * RowsDone;
FObjectSizesDoneExact := FObjectSizesDone + BytesDone;
LogRow[2] := FormatNumber(RowsDone) + ' / ' + FormatNumber(Percent, 0)+'%';

0 comments on commit 91c8ff1

Please sign in to comment.
You can’t perform that action at this time.