mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 05:15:01 -06:00
4.63
This commit is contained in:
committed by
Kornel Lesiński
parent
c1f1243a70
commit
3a524e5ba2
@@ -19,7 +19,8 @@
|
||||
#include "Windows/Time.h"
|
||||
|
||||
#include "../../Common/FileStreams.h"
|
||||
#include "../../Compress/Copy/CopyCoder.h"
|
||||
|
||||
#include "../../Compress/CopyCoder.h"
|
||||
|
||||
#include "../Common/DirItem.h"
|
||||
#include "../Common/EnumDirItems.h"
|
||||
@@ -285,6 +286,22 @@ bool CUpdateOptions::Init(const CCodecs *codecs, const CIntVector &formatIndices
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
struct CUpdateProduceCallbackImp: public IUpdateProduceCallback
|
||||
{
|
||||
const CObjectVector<CArcItem> *_arcItems;
|
||||
IUpdateCallbackUI *_callback;
|
||||
|
||||
CUpdateProduceCallbackImp(const CObjectVector<CArcItem> *a,
|
||||
IUpdateCallbackUI *callback): _arcItems(a), _callback(callback) {}
|
||||
virtual HRESULT ShowDeleteFile(int arcIndex);
|
||||
};
|
||||
|
||||
HRESULT CUpdateProduceCallbackImp::ShowDeleteFile(int arcIndex)
|
||||
{
|
||||
return _callback->ShowDeleteFile((*_arcItems)[arcIndex].Name);
|
||||
}
|
||||
*/
|
||||
|
||||
static HRESULT Compress(
|
||||
CCodecs *codecs,
|
||||
@@ -351,7 +368,8 @@ static HRESULT Compress(
|
||||
{
|
||||
CRecordVector<CUpdatePair> updatePairs;
|
||||
GetUpdatePairInfoList(dirItems, arcItems, fileTimeType, updatePairs); // must be done only once!!!
|
||||
UpdateProduce(updatePairs, actionSet, updatePairs2);
|
||||
// CUpdateProduceCallbackImp upCallback(&arcItems, callback);
|
||||
UpdateProduce(updatePairs, actionSet, updatePairs2, NULL /* &upCallback */);
|
||||
}
|
||||
|
||||
UInt32 numFiles = 0;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
virtual HRESULT OpenFileError(const wchar_t *name, DWORD systemError) x; \
|
||||
virtual HRESULT SetOperationResult(Int32 operationResult) x; \
|
||||
virtual HRESULT CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password) x; \
|
||||
|
||||
// virtual HRESULT ShowDeleteFile(const wchar_t *name) x; \
|
||||
// virtual HRESULT CloseProgress() { return S_OK; };
|
||||
|
||||
struct IUpdateCallbackUI
|
||||
|
||||
@@ -10,8 +10,9 @@ static const char *kUpdateActionSetCollision = "Internal collision in update act
|
||||
|
||||
void UpdateProduce(
|
||||
const CRecordVector<CUpdatePair> &updatePairs,
|
||||
const NUpdateArchive::CActionSet &actionSet,
|
||||
CRecordVector<CUpdatePair2> &operationChain)
|
||||
const CActionSet &actionSet,
|
||||
CRecordVector<CUpdatePair2> &operationChain,
|
||||
IUpdateProduceCallback *callback)
|
||||
{
|
||||
for (int i = 0; i < updatePairs.Size(); i++)
|
||||
{
|
||||
@@ -22,6 +23,7 @@ void UpdateProduce(
|
||||
up2.DirIndex = pair.DirIndex;
|
||||
up2.ArcIndex = pair.ArcIndex;
|
||||
up2.NewData = up2.NewProps = true;
|
||||
|
||||
switch(actionSet.StateActions[pair.State])
|
||||
{
|
||||
case NPairAction::kIgnore:
|
||||
@@ -30,6 +32,8 @@ void UpdateProduce(
|
||||
IgnoreArchiveItem(m_ArchiveItems[pair.ArcIndex]);
|
||||
// cout << "deleting";
|
||||
*/
|
||||
if (callback)
|
||||
callback->ShowDeleteFile(pair.ArcIndex);
|
||||
continue;
|
||||
|
||||
case NPairAction::kCopy:
|
||||
|
||||
@@ -21,9 +21,15 @@ struct CUpdatePair2
|
||||
CUpdatePair2(): IsAnti(false), DirIndex(-1), ArcIndex(-1), NewNameIndex(-1) {}
|
||||
};
|
||||
|
||||
struct IUpdateProduceCallback
|
||||
{
|
||||
virtual HRESULT ShowDeleteFile(int arcIndex) = 0;
|
||||
};
|
||||
|
||||
void UpdateProduce(
|
||||
const CRecordVector<CUpdatePair> &updatePairs,
|
||||
const NUpdateArchive::CActionSet &actionSet,
|
||||
CRecordVector<CUpdatePair2> &operationChain);
|
||||
CRecordVector<CUpdatePair2> &operationChain,
|
||||
IUpdateProduceCallback *callback);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user