mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 09:15:00 -06:00
15.05
This commit is contained in:
committed by
Kornel Lesiński
parent
0713a3ab80
commit
54490d51d5
@@ -4,11 +4,13 @@
|
||||
|
||||
#include "ProgressUtils.h"
|
||||
|
||||
CLocalProgress::CLocalProgress()
|
||||
{
|
||||
ProgressOffset = InSize = OutSize = 0;
|
||||
SendRatio = SendProgress = true;
|
||||
}
|
||||
CLocalProgress::CLocalProgress():
|
||||
ProgressOffset(0),
|
||||
InSize(0),
|
||||
OutSize(0),
|
||||
SendRatio(true),
|
||||
SendProgress(true)
|
||||
{}
|
||||
|
||||
void CLocalProgress::Init(IProgress *progress, bool inSizeIsMain)
|
||||
{
|
||||
@@ -20,19 +22,26 @@ void CLocalProgress::Init(IProgress *progress, bool inSizeIsMain)
|
||||
|
||||
STDMETHODIMP CLocalProgress::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
|
||||
{
|
||||
UInt64 inSizeNew = InSize, outSizeNew = OutSize;
|
||||
UInt64 inSize2 = InSize;
|
||||
UInt64 outSize2 = OutSize;
|
||||
|
||||
if (inSize)
|
||||
inSizeNew += (*inSize);
|
||||
inSize2 += (*inSize);
|
||||
if (outSize)
|
||||
outSizeNew += (*outSize);
|
||||
outSize2 += (*outSize);
|
||||
|
||||
if (SendRatio && _ratioProgress)
|
||||
{
|
||||
RINOK(_ratioProgress->SetRatioInfo(&inSizeNew, &outSizeNew));
|
||||
RINOK(_ratioProgress->SetRatioInfo(&inSize2, &outSize2));
|
||||
}
|
||||
inSizeNew += ProgressOffset;
|
||||
outSizeNew += ProgressOffset;
|
||||
|
||||
if (SendProgress)
|
||||
return _progress->SetCompleted(_inSizeIsMain ? &inSizeNew : &outSizeNew);
|
||||
{
|
||||
inSize2 += ProgressOffset;
|
||||
outSize2 += ProgressOffset;
|
||||
return _progress->SetCompleted(_inSizeIsMain ? &inSize2 : &outSize2);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user