diff options
Diffstat (limited to 'CPP/7zip/UI/Common')
-rwxr-xr-x | CPP/7zip/UI/Common/Update.cpp | 22 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/UpdateCallback.h | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/UpdateProduce.cpp | 8 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/UpdateProduce.h | 8 |
4 files changed, 34 insertions, 6 deletions
diff --git a/CPP/7zip/UI/Common/Update.cpp b/CPP/7zip/UI/Common/Update.cpp index f2207557..1f88a6f0 100755 --- a/CPP/7zip/UI/Common/Update.cpp +++ b/CPP/7zip/UI/Common/Update.cpp @@ -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; diff --git a/CPP/7zip/UI/Common/UpdateCallback.h b/CPP/7zip/UI/Common/UpdateCallback.h index 411ee011..2a814b37 100755 --- a/CPP/7zip/UI/Common/UpdateCallback.h +++ b/CPP/7zip/UI/Common/UpdateCallback.h @@ -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 diff --git a/CPP/7zip/UI/Common/UpdateProduce.cpp b/CPP/7zip/UI/Common/UpdateProduce.cpp index b2bc59a5..c21db3b2 100755 --- a/CPP/7zip/UI/Common/UpdateProduce.cpp +++ b/CPP/7zip/UI/Common/UpdateProduce.cpp @@ -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: diff --git a/CPP/7zip/UI/Common/UpdateProduce.h b/CPP/7zip/UI/Common/UpdateProduce.h index 7e1a4a3f..e18648cd 100755 --- a/CPP/7zip/UI/Common/UpdateProduce.h +++ b/CPP/7zip/UI/Common/UpdateProduce.h @@ -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 |