This commit is contained in:
Igor Pavlov
2015-06-15 00:00:00 +00:00
committed by Kornel Lesiński
parent 0713a3ab80
commit 54490d51d5
591 changed files with 34932 additions and 16390 deletions

View File

@@ -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;
}