mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Progress with memory pack
This commit is contained in:
parent
053f28ccae
commit
412ab131cc
2 changed files with 7 additions and 2 deletions
|
|
@ -243,6 +243,7 @@ begin
|
|||
|
||||
with FStatistics do
|
||||
begin
|
||||
if FTarBefore then CurrentFileDoneBytes := -1;
|
||||
CurrentFileTo:= FWcxArchiveFileSource.ArchiveFileName;
|
||||
UpdateStatistics(FStatistics);
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -705,6 +705,7 @@ function TTarWriter.ProcessTree(var Files: TFiles;
|
|||
var Statistics: TFileSourceCopyOperationStatistics): Boolean;
|
||||
var
|
||||
aFile: TFile;
|
||||
Divider: Int64 = 1;
|
||||
CurrentFileIndex: Integer;
|
||||
iTotalDiskSize, iFreeDiskSize: Int64;
|
||||
begin
|
||||
|
|
@ -712,10 +713,13 @@ begin
|
|||
Result:= False;
|
||||
// Set base path
|
||||
FBasePath:= Files.Path;
|
||||
if FMemPack = 0 then begin
|
||||
Divider:= 2;
|
||||
end;
|
||||
// Update progress
|
||||
with Statistics do
|
||||
begin
|
||||
TotalBytes:= TotalBytes * 2;
|
||||
TotalBytes:= TotalBytes * Divider;
|
||||
UpdateStatistics(Statistics);
|
||||
end;
|
||||
// Check disk free space
|
||||
|
|
@ -766,7 +770,7 @@ begin
|
|||
if Assigned(FTargetStream) then
|
||||
begin
|
||||
FreeAndNil(FTargetStream);
|
||||
if (Statistics.DoneBytes <> Statistics.TotalBytes div 2) then
|
||||
if (Statistics.DoneBytes <> Statistics.TotalBytes div Divider) then
|
||||
// There was some error, because not all files has been archived.
|
||||
// Delete the not completed target file.
|
||||
mbDeleteFile(FArchiveFileName)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue