diff options
Diffstat (limited to 'CPP/7zip/UI/Common')
-rwxr-xr-x | CPP/7zip/UI/Common/ArchiveExtractCallback.cpp | 5 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/ArchiveExtractCallback.h | 1 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/Extract.cpp | 11 |
3 files changed, 11 insertions, 6 deletions
diff --git a/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp b/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp index 7e97b542..9e679e57 100755 --- a/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp +++ b/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp @@ -41,7 +41,6 @@ void CArchiveExtractCallback::Init( { _stdOutMode = stdOutMode; _numErrors = 0; - _ratioMode = false; _unpTotal = 1; _packTotal = packSize; @@ -50,6 +49,7 @@ void CArchiveExtractCallback::Init( _extractCallback2.QueryInterface(IID_ICompressProgressInfo, &_compressProgress); LocalProgressSpec->Init(extractCallback2, true); + LocalProgressSpec->SendProgress = false; _itemDefaultName = itemDefaultName; _utcLastWriteTimeDefault = utcLastWriteTimeDefault; @@ -97,8 +97,6 @@ STDMETHODIMP CArchiveExtractCallback::SetCompleted(const UInt64 *completeValue) if (_multiArchives) { - if (_ratioMode) - return S_OK; if (completeValue != NULL) { UInt64 packCur = LocalProgressSpec->InSize + MyMultDiv64(*completeValue, _unpTotal, _packTotal); @@ -112,7 +110,6 @@ STDMETHODIMP CArchiveExtractCallback::SetCompleted(const UInt64 *completeValue) STDMETHODIMP CArchiveExtractCallback::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) { COM_TRY_BEGIN - _ratioMode = true; return _localProgress->SetRatioInfo(inSize, outSize); COM_TRY_END } diff --git a/CPP/7zip/UI/Common/ArchiveExtractCallback.h b/CPP/7zip/UI/Common/ArchiveExtractCallback.h index f24f5b87..fd30d64d 100755 --- a/CPP/7zip/UI/Common/ArchiveExtractCallback.h +++ b/CPP/7zip/UI/Common/ArchiveExtractCallback.h @@ -105,7 +105,6 @@ public: CLocalProgress *LocalProgressSpec; CMyComPtr<ICompressProgressInfo> _localProgress; - bool _ratioMode; UInt64 _packTotal; UInt64 _unpTotal; diff --git a/CPP/7zip/UI/Common/Extract.cpp b/CPP/7zip/UI/Common/Extract.cpp index faf0f727..0e56a08a 100755 --- a/CPP/7zip/UI/Common/Extract.cpp +++ b/CPP/7zip/UI/Common/Extract.cpp @@ -91,6 +91,7 @@ HRESULT DecompressArchives( CExtractOptions options = optionsSpec; int i; UInt64 totalPackSize = 0; + CRecordVector<UInt64> archiveSizes; for (i = 0; i < archivePaths.Size(); i++) { const UString &archivePath = archivePaths[i]; @@ -99,6 +100,7 @@ HRESULT DecompressArchives( throw "there is no such archive"; if (archiveFileInfo.IsDirectory()) throw "can't decompress folder"; + archiveSizes.Add(archiveFileInfo.Size); totalPackSize += archiveFileInfo.Size; } CArchiveExtractCallback *extractCallbackSpec = new CArchiveExtractCallback; @@ -145,8 +147,15 @@ HRESULT DecompressArchives( { archivePaths.Delete(index); archivePathsFull.Delete(index); + totalPackSize -= archiveSizes[index]; + archiveSizes.Delete(index); } } + if (archiveLink.VolumePaths.Size() != 0) + { + totalPackSize += archiveLink.VolumesSize; + RINOK(extractCallback->SetTotal(totalPackSize)); + } #ifndef _NO_CRYPTO UString password; @@ -160,7 +169,7 @@ HRESULT DecompressArchives( options.DefaultItemName = archiveLink.GetDefaultItemName(); RINOK(DecompressArchive( archiveLink.GetArchive(), - archiveFileInfo.Size, + archiveFileInfo.Size + archiveLink.VolumesSize, archiveLink.GetDefaultItemName(), wildcardCensor, options, extractCallback, extractCallbackSpec, errorMessage)); extractCallbackSpec->LocalProgressSpec->InSize += archiveFileInfo.Size + |