mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-06-14 03:16:38 +10:00
Revert "Auto-detect when setting is back to default value"
This reverts commit 998d83c15c.
This change was wrong and it shouldn't get merged in first place.
See https://github.com/Open-Shell/Open-Shell-Menu/pull/829#issuecomment-907667829 for further explanation.
Fixes #1135.
This commit is contained in:
@@ -1828,10 +1828,7 @@ void CCustomTreeDlg::SerializeData( void )
|
||||
if ((m_pSetting->flags&CSetting::FLAG_DEFAULT) || wcscmp(strNew,strOld)!=0)
|
||||
SetSettingsDirty();
|
||||
m_pSetting->value=CComVariant(strNew);
|
||||
if (m_pSetting->value==m_pSetting->defValue)
|
||||
m_pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
m_pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
m_pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
ItemsChanged();
|
||||
}
|
||||
|
||||
@@ -2811,10 +2808,7 @@ void CTreeSettingsDlg::ToggleItem( HTREEITEM hItem, bool bDefault )
|
||||
{
|
||||
CSettingsLockWrite lock;
|
||||
pSetting->value=CComVariant(state?0:1);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
SetSettingsDirty();
|
||||
}
|
||||
if (pSetting->flags&CSetting::FLAG_CALLBACK)
|
||||
@@ -2838,10 +2832,7 @@ void CTreeSettingsDlg::ToggleItem( HTREEITEM hItem, bool bDefault )
|
||||
{
|
||||
CSettingsLockWrite lock;
|
||||
pTarget->value=CComVariant(val);
|
||||
if (pTarget->value==pTarget->defValue)
|
||||
pTarget->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pTarget->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pTarget->flags&=~CSetting::FLAG_DEFAULT;
|
||||
SetSettingsDirty();
|
||||
}
|
||||
if (pParent->flags&CSetting::FLAG_CALLBACK)
|
||||
@@ -3052,10 +3043,7 @@ void CTreeSettingsDlg::ApplyEditBox( void )
|
||||
if (pSetting->value.vt!=VT_I4 || pSetting->value.intVal!=val)
|
||||
{
|
||||
pSetting->value=CComVariant(val);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
}
|
||||
else if (pSetting->type==CSetting::TYPE_COLOR)
|
||||
@@ -3065,10 +3053,7 @@ void CTreeSettingsDlg::ApplyEditBox( void )
|
||||
if (pSetting->value.vt!=VT_I4 || pSetting->value.intVal!=val)
|
||||
{
|
||||
pSetting->value=CComVariant(val);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
}
|
||||
else if (pSetting->type==CSetting::TYPE_HOTKEY || pSetting->type==CSetting::TYPE_HOTKEY_ANY)
|
||||
@@ -3076,10 +3061,7 @@ void CTreeSettingsDlg::ApplyEditBox( void )
|
||||
if (pSetting->value.vt!=VT_I4 || pSetting->value.intVal!=g_HotKey)
|
||||
{
|
||||
pSetting->value=CComVariant(g_HotKey);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
}
|
||||
else if (pSetting->type==CSetting::TYPE_DIRECTORY)
|
||||
@@ -3101,10 +3083,7 @@ void CTreeSettingsDlg::ApplyEditBox( void )
|
||||
if (pSetting->value.vt!=VT_BSTR || str!=pSetting->value.bstrVal)
|
||||
{
|
||||
pSetting->value=CComVariant(str);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
}
|
||||
SetSettingsDirty();
|
||||
|
||||
Reference in New Issue
Block a user