ZipRegistry.cpp (p7zip_15.14.1_src_all) | : | ZipRegistry.cpp (p7zip_16.02_src_all) | ||
---|---|---|---|---|
skipping to change at line 45 | skipping to change at line 45 | |||
if (b.Def) | if (b.Def) | |||
key.SetValue(name, b.Val); | key.SetValue(name, b.Val); | |||
} | } | |||
static void Key_Get_BoolPair(CKey &key, LPCTSTR name, CBoolPair &b) | static void Key_Get_BoolPair(CKey &key, LPCTSTR name, CBoolPair &b) | |||
{ | { | |||
b.Val = false; | b.Val = false; | |||
b.Def = (key.GetValue_IfOk(name, b.Val) == ERROR_SUCCESS); | b.Def = (key.GetValue_IfOk(name, b.Val) == ERROR_SUCCESS); | |||
} | } | |||
static void Key_Get_BoolPair_true(CKey &key, LPCTSTR name, CBoolPair &b) | ||||
{ | ||||
b.Val = true; | ||||
b.Def = (key.GetValue_IfOk(name, b.Val) == ERROR_SUCCESS); | ||||
} | ||||
namespace NExtract | namespace NExtract | |||
{ | { | |||
static const TCHAR *kKeyName = TEXT("Extraction"); | static const TCHAR *kKeyName = TEXT("Extraction"); | |||
static const TCHAR *kExtractMode = TEXT("ExtractMode"); | static const TCHAR *kExtractMode = TEXT("ExtractMode"); | |||
static const TCHAR *kOverwriteMode = TEXT("OverwriteMode"); | static const TCHAR *kOverwriteMode = TEXT("OverwriteMode"); | |||
static const TCHAR *kShowPassword = TEXT("ShowPassword"); | static const TCHAR *kShowPassword = TEXT("ShowPassword"); | |||
static const TCHAR *kPathHistory = TEXT("PathHistory"); | static const TCHAR *kPathHistory = TEXT("PathHistory"); | |||
static const TCHAR *kSplitDest = TEXT("SplitDest"); | static const TCHAR *kSplitDest = TEXT("SplitDest"); | |||
skipping to change at line 95 | skipping to change at line 101 | |||
key.SetValue(kShowPassword, showPassword); | key.SetValue(kShowPassword, showPassword); | |||
} | } | |||
void CInfo::Load() | void CInfo::Load() | |||
{ | { | |||
PathMode = NPathMode::kCurPaths; | PathMode = NPathMode::kCurPaths; | |||
PathMode_Force = false; | PathMode_Force = false; | |||
OverwriteMode = NOverwriteMode::kAsk; | OverwriteMode = NOverwriteMode::kAsk; | |||
OverwriteMode_Force = false; | OverwriteMode_Force = false; | |||
SplitDest.Val = true; | ||||
Paths.Clear(); | Paths.Clear(); | |||
CS_LOCK | CS_LOCK | |||
CKey key; | CKey key; | |||
if (OpenMainKey(key, kKeyName) != ERROR_SUCCESS) | if (OpenMainKey(key, kKeyName) != ERROR_SUCCESS) | |||
return; | return; | |||
key.GetValue_Strings(kPathHistory, Paths); | key.GetValue_Strings(kPathHistory, Paths); | |||
UInt32 v; | UInt32 v; | |||
if (key.QueryValue(kExtractMode, v) == ERROR_SUCCESS && v <= NPathMode::kAbsPa ths) | if (key.QueryValue(kExtractMode, v) == ERROR_SUCCESS && v <= NPathMode::kAbsPa ths) | |||
{ | { | |||
PathMode = (NPathMode::EEnum)v; | PathMode = (NPathMode::EEnum)v; | |||
PathMode_Force = true; | PathMode_Force = true; | |||
} | } | |||
if (key.QueryValue(kOverwriteMode, v) == ERROR_SUCCESS && v <= NOverwriteMode: :kRenameExisting) | if (key.QueryValue(kOverwriteMode, v) == ERROR_SUCCESS && v <= NOverwriteMode: :kRenameExisting) | |||
{ | { | |||
OverwriteMode = (NOverwriteMode::EEnum)v; | OverwriteMode = (NOverwriteMode::EEnum)v; | |||
OverwriteMode_Force = true; | OverwriteMode_Force = true; | |||
} | } | |||
Key_Get_BoolPair(key, kSplitDest, SplitDest); | Key_Get_BoolPair_true(key, kSplitDest, SplitDest); | |||
if (!SplitDest.Def) | ||||
SplitDest.Val = true; | ||||
Key_Get_BoolPair(key, kElimDup, ElimDup); | Key_Get_BoolPair(key, kElimDup, ElimDup); | |||
// Key_Get_BoolPair(key, kAltStreams, AltStreams); | // Key_Get_BoolPair(key, kAltStreams, AltStreams); | |||
Key_Get_BoolPair(key, kNtSecur, NtSecurity); | Key_Get_BoolPair(key, kNtSecur, NtSecurity); | |||
Key_Get_BoolPair(key, kShowPassword, ShowPassword); | Key_Get_BoolPair(key, kShowPassword, ShowPassword); | |||
} | } | |||
bool Read_ShowPassword() | bool Read_ShowPassword() | |||
{ | { | |||
CS_LOCK | CS_LOCK | |||
CKey key; | CKey key; | |||
skipping to change at line 350 | skipping to change at line 357 | |||
Mode = NMode::kSystem; | Mode = NMode::kSystem; | |||
} | } | |||
key.GetValue_IfOk(kTempRemovableOnly, ForRemovableOnly); | key.GetValue_IfOk(kTempRemovableOnly, ForRemovableOnly); | |||
} | } | |||
} | } | |||
static const TCHAR *kCascadedMenu = TEXT("CascadedMenu"); | static const TCHAR *kCascadedMenu = TEXT("CascadedMenu"); | |||
static const TCHAR *kContextMenu = TEXT("ContextMenu"); | static const TCHAR *kContextMenu = TEXT("ContextMenu"); | |||
static const TCHAR *kMenuIcons = TEXT("MenuIcons"); | static const TCHAR *kMenuIcons = TEXT("MenuIcons"); | |||
static const TCHAR *kElimDup = TEXT("ElimDupExtract"); | ||||
void CContextMenuInfo::Save() const | void CContextMenuInfo::Save() const | |||
{ | { | |||
CS_LOCK | CS_LOCK | |||
CKey key; | CKey key; | |||
CreateMainKey(key, kOptionsInfoKeyName); | CreateMainKey(key, kOptionsInfoKeyName); | |||
key.SetValue(kCascadedMenu, Cascaded); | ||||
key.SetValue(kMenuIcons, MenuIcons); | Key_Set_BoolPair(key, kCascadedMenu, Cascaded); | |||
key.SetValue(kContextMenu, Flags); | Key_Set_BoolPair(key, kMenuIcons, MenuIcons); | |||
Key_Set_BoolPair(key, kElimDup, ElimDup); | ||||
if (Flags_Def) | ||||
key.SetValue(kContextMenu, Flags); | ||||
} | } | |||
void CContextMenuInfo::Load() | void CContextMenuInfo::Load() | |||
{ | { | |||
MenuIcons = false; | Cascaded.Val = true; | |||
Cascaded = true; | Cascaded.Def = false; | |||
MenuIcons.Val = false; | ||||
MenuIcons.Def = false; | ||||
ElimDup.Val = true; | ||||
ElimDup.Def = false; | ||||
Flags = (UInt32)(Int32)-1; | Flags = (UInt32)(Int32)-1; | |||
Flags_Def = false; | ||||
CS_LOCK | CS_LOCK | |||
CKey key; | CKey key; | |||
if (OpenMainKey(key, kOptionsInfoKeyName) != ERROR_SUCCESS) | if (OpenMainKey(key, kOptionsInfoKeyName) != ERROR_SUCCESS) | |||
return; | return; | |||
key.GetValue_IfOk(kCascadedMenu, Cascaded); | ||||
key.GetValue_IfOk(kMenuIcons, MenuIcons); | Key_Get_BoolPair_true(key, kCascadedMenu, Cascaded); | |||
key.GetValue_IfOk(kContextMenu, Flags); | Key_Get_BoolPair_true(key, kElimDup, ElimDup); | |||
Key_Get_BoolPair(key, kMenuIcons, MenuIcons); | ||||
Flags_Def = (key.GetValue_IfOk(kContextMenu, Flags) == ERROR_SUCCESS); | ||||
} | } | |||
End of changes. 9 change blocks. | ||||
11 lines changed or deleted | 36 lines changed or added |