diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2015-06-15 03:00:00 +0300 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:16:54 +0300 |
commit | 54490d51d5c6b0d794dcbad2d634d4c95fc25b6c (patch) | |
tree | c3c413656432c0ef87b2841c80e42b55ad17d4e8 /CPP/7zip/UI/GUI/GUI.cpp | |
parent | 0713a3ab803e57401f18432148b4139e5fe6e5dd (diff) |
15.0515.05
Diffstat (limited to 'CPP/7zip/UI/GUI/GUI.cpp')
-rw-r--r-- | CPP/7zip/UI/GUI/GUI.cpp | 58 |
1 files changed, 43 insertions, 15 deletions
diff --git a/CPP/7zip/UI/GUI/GUI.cpp b/CPP/7zip/UI/GUI/GUI.cpp index 592f7673..134ac021 100644 --- a/CPP/7zip/UI/GUI/GUI.cpp +++ b/CPP/7zip/UI/GUI/GUI.cpp @@ -126,14 +126,8 @@ static int Main2() #endif #endif - CCodecs *codecs = new CCodecs; - #ifdef EXTERNAL_CODECS - CExternalCodecs __externalCodecs; - __externalCodecs.GetCodecs = codecs; - __externalCodecs.GetHashers = codecs; - #else - CMyComPtr<IUnknown> compressCodecsInfo = codecs; - #endif + CREATE_CODECS_OBJECT + codecs->CaseSensitiveChange = options.CaseSensitiveChange; codecs->CaseSensitive = options.CaseSensitive; ThrowException_if_Error(codecs->Load()); @@ -144,8 +138,18 @@ static int Main2() (isExtractGroupCommand || options.Command.IsFromUpdateGroup())) + { + #ifdef EXTERNAL_CODECS + if (!codecs->MainDll_ErrorPath.IsEmpty()) + { + UString s = L"7-Zip cannot load module "; + s += fs2us(codecs->MainDll_ErrorPath); + throw s; + } + #endif throw kNoFormats; - + } + CObjectVector<COpenType> formatIndices; if (!ParseOpenTypes(*codecs, options.ArcType, formatIndices)) { @@ -171,12 +175,12 @@ static int Main2() if (isExtractGroupCommand || options.Command.CommandType == NCommandType::kHash || options.Command.CommandType == NCommandType::kBenchmark) - ThrowException_if_Error(__externalCodecs.LoadCodecs()); + ThrowException_if_Error(__externalCodecs.Load()); #endif if (options.Command.CommandType == NCommandType::kBenchmark) { - HRESULT res = Benchmark(EXTERNAL_CODECS_VARS options.Properties); + HRESULT res = Benchmark(EXTERNAL_CODECS_VARS_L options.Properties); /* if (res == S_FALSE) { @@ -188,6 +192,9 @@ static int Main2() } else if (isExtractGroupCommand) { + UStringVector ArchivePathsSorted; + UStringVector ArchivePathsFullSorted; + CExtractCallbackImp *ecs = new CExtractCallbackImp; CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs; @@ -218,14 +225,35 @@ static int Main2() if (!options.HashMethods.IsEmpty()) { hb_ptr = &hb; - ThrowException_if_Error(hb.SetMethods(EXTERNAL_CODECS_VARS options.HashMethods)); + ThrowException_if_Error(hb.SetMethods(EXTERNAL_CODECS_VARS_L options.HashMethods)); } #endif + { + CDirItemsStat st; + HRESULT hresultMain = EnumerateDirItemsAndSort( + options.arcCensor, + NWildcard::k_RelatPath, + UString(), // addPathPrefix + ArchivePathsSorted, + ArchivePathsFullSorted, + st, + NULL // &scan: change it!!!! + ); + if (hresultMain != S_OK) + { + /* + if (hresultMain != E_ABORT && messageWasDisplayed) + return NExitCode::kFatalError; + */ + throw CSystemException(hresultMain); + } + } + HRESULT result = ExtractGUI(codecs, formatIndices, excludedFormatIndices, - options.ArchivePathsSorted, - options.ArchivePathsFullSorted, + ArchivePathsSorted, + ArchivePathsFullSorted, options.Censor.Pairs.Front().Head, eo, #ifndef _SFX @@ -291,7 +319,7 @@ static int Main2() else if (options.Command.CommandType == NCommandType::kHash) { bool messageWasDisplayed = false; - HRESULT result = HashCalcGUI(EXTERNAL_CODECS_VARS + HRESULT result = HashCalcGUI(EXTERNAL_CODECS_VARS_L options.Censor, options.HashOptions, messageWasDisplayed); if (result != S_OK) |