X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d5da0ce7cb746318511b3974b7882c72c0de45e2..9d529fa05c2bef6aa4ae9f08b39bb7c0a4fe5c59:/src/msw/regconf.cpp diff --git a/src/msw/regconf.cpp b/src/msw/regconf.cpp index 13807770df..19481f6b37 100644 --- a/src/msw/regconf.cpp +++ b/src/msw/regconf.cpp @@ -25,10 +25,9 @@ #include "wx/intl.h" #include "wx/log.h" #include "wx/event.h" + #include "wx/app.h" #endif //WX_PRECOMP -#include "wx/app.h" - #include "wx/msw/registry.h" #include "wx/msw/regconf.h" @@ -61,6 +60,7 @@ bool TryGetValue(const wxRegKey& key, const wxString& str, long *plVal) // ---------------------------------------------------------------------------- // ctor/dtor // ---------------------------------------------------------------------------- +IMPLEMENT_ABSTRACT_CLASS(wxRegConfig, wxConfigBase) // create the config object which stores its data under HKCU\vendor\app and, if // style & wxCONFIG_USE_GLOBAL_FILE, under HKLM\vendor\app @@ -698,9 +698,20 @@ bool wxRegConfig::DeleteEntry(const wxString& value, bool bGroupIfEmptyAlso) bool wxRegConfig::DeleteGroup(const wxString& key) { - wxConfigPathChanger path(this, key); + wxConfigPathChanger path(this, RemoveTrailingSeparator(key)); + + if ( !m_keyLocal.Exists() ) + { + // nothing to do + return true; + } + + if ( !LocalKey().DeleteKey(path.Name()) ) + return false; - return m_keyLocal.Exists() ? LocalKey().DeleteKey(path.Name()) : true; + path.UpdateIfDeleted(); + + return true; } bool wxRegConfig::DeleteAll() @@ -718,5 +729,4 @@ bool wxRegConfig::DeleteAll() return bOk; } -#endif - // wxUSE_CONFIG +#endif // wxUSE_CONFIG