This commit is contained in:
Igor Pavlov
2008-12-31 00:00:00 +00:00
committed by Kornel Lesiński
parent c1f1243a70
commit 3a524e5ba2
259 changed files with 2792 additions and 4855 deletions

View File

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

View File

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

View File

@@ -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:

View File

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