honour the 2nd parameter of DeleteEntry() instead of always deleting empty groups unconditionally (patch 896303)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26006 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -688,7 +688,8 @@ bool wxRegConfig::RenameGroup(const wxString& oldName, const wxString& newName)
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// deleting
|
// deleting
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
bool wxRegConfig::DeleteEntry(const wxString& value, bool WXUNUSED(bGroupIfEmptyAlso))
|
|
||||||
|
bool wxRegConfig::DeleteEntry(const wxString& value, bool bGroupIfEmptyAlso)
|
||||||
{
|
{
|
||||||
wxConfigPathChanger path(this, value);
|
wxConfigPathChanger path(this, value);
|
||||||
|
|
||||||
@@ -696,7 +697,7 @@ bool wxRegConfig::DeleteEntry(const wxString& value, bool WXUNUSED(bGroupIfEmpty
|
|||||||
if ( !m_keyLocal.DeleteValue(path.Name()) )
|
if ( !m_keyLocal.DeleteValue(path.Name()) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if ( m_keyLocal.IsEmpty() ) {
|
if ( bGroupIfEmptyAlso && m_keyLocal.IsEmpty() ) {
|
||||||
wxString strKey = GetPath().AfterLast(wxCONFIG_PATH_SEPARATOR);
|
wxString strKey = GetPath().AfterLast(wxCONFIG_PATH_SEPARATOR);
|
||||||
SetPath(_T("..")); // changes m_keyLocal
|
SetPath(_T("..")); // changes m_keyLocal
|
||||||
return LocalKey().DeleteKey(strKey);
|
return LocalKey().DeleteKey(strKey);
|
||||||
|
Reference in New Issue
Block a user