mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 13:14:59 -06:00
9.04 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
8874e4fbc9
commit
829409452d
@@ -2,50 +2,48 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "OpenCallback.h"
|
||||
|
||||
#include "Common/StringConvert.h"
|
||||
|
||||
#include "Windows/PropVariant.h"
|
||||
|
||||
#include "../../Common/FileStreams.h"
|
||||
|
||||
#include "OpenCallback.h"
|
||||
#include "PasswordDialog.h"
|
||||
|
||||
using namespace NWindows;
|
||||
|
||||
STDMETHODIMP COpenArchiveCallback::SetTotal(const UInt64 *numFiles, const UInt64 *numBytes)
|
||||
{
|
||||
RINOK(ProgressDialog.ProgressSynch.ProcessStopAndPause());
|
||||
{
|
||||
NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
|
||||
_numFilesTotalDefined = (numFiles != NULL);
|
||||
_numBytesTotalDefined = (numBytes != NULL);
|
||||
if (_numFilesTotalDefined)
|
||||
NSynchronization::CCriticalSectionLock lock(_criticalSection);
|
||||
if (numFiles != NULL)
|
||||
{
|
||||
ProgressDialog.ProgressSynch.SetNumFilesTotal(*numFiles);
|
||||
ProgressDialog.ProgressSynch.SetProgress(*numFiles, 0);
|
||||
ProgressDialog.ProgressSynch.SetBytesProgressMode(false);
|
||||
}
|
||||
else if (_numBytesTotalDefined)
|
||||
ProgressDialog.ProgressSynch.SetProgress(*numBytes, 0);
|
||||
if (numBytes != NULL)
|
||||
ProgressDialog.ProgressSynch.SetNumBytesTotal(*numBytes);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP COpenArchiveCallback::SetCompleted(const UInt64 *numFiles, const UInt64 *numBytes)
|
||||
{
|
||||
NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
|
||||
RINOK(ProgressDialog.ProgressSynch.ProcessStopAndPause());
|
||||
NSynchronization::CCriticalSectionLock lock(_criticalSection);
|
||||
if (numFiles != NULL)
|
||||
{
|
||||
ProgressDialog.ProgressSynch.SetNumFilesCur(*numFiles);
|
||||
if (_numFilesTotalDefined)
|
||||
ProgressDialog.ProgressSynch.SetPos(*numFiles);
|
||||
}
|
||||
if (numBytes != NULL && _numBytesTotalDefined)
|
||||
if (numBytes != NULL)
|
||||
ProgressDialog.ProgressSynch.SetPos(*numBytes);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP COpenArchiveCallback::SetTotal(const UInt64 total)
|
||||
{
|
||||
ProgressDialog.ProgressSynch.SetProgress(total, 0);
|
||||
RINOK(ProgressDialog.ProgressSynch.ProcessStopAndPause());
|
||||
ProgressDialog.ProgressSynch.SetNumBytesTotal(total);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -59,7 +57,7 @@ STDMETHODIMP COpenArchiveCallback::SetCompleted(const UInt64 *completed)
|
||||
|
||||
STDMETHODIMP COpenArchiveCallback::GetProperty(PROPID propID, PROPVARIANT *value)
|
||||
{
|
||||
NWindows::NCOM::CPropVariant prop;
|
||||
NCOM::CPropVariant prop;
|
||||
if (_subArchiveMode)
|
||||
{
|
||||
switch(propID)
|
||||
@@ -91,10 +89,10 @@ STDMETHODIMP COpenArchiveCallback::GetStream(const wchar_t *name,
|
||||
if (_subArchiveMode)
|
||||
return S_FALSE;
|
||||
|
||||
NWindows::NFile::NFind::CFileInfoW fileInfo;
|
||||
NFile::NFind::CFileInfoW fileInfo;
|
||||
|
||||
UString fullPath = _folderPrefix + name;
|
||||
if (!NWindows::NFile::NFind::FindFile(fullPath, fileInfo))
|
||||
if (!fileInfo.Find(fullPath))
|
||||
return S_FALSE;
|
||||
_fileInfo = fileInfo;
|
||||
if (_fileInfo.IsDir())
|
||||
|
||||
Reference in New Issue
Block a user