From: Vadim Zeitlin Date: Sat, 15 Jul 2006 22:07:00 +0000 (+0000) Subject: fix the bug with the current path being restored if it was under the group being... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9c92620c221c68f240798fa78d03e3cb172f61ce?ds=inline fix the bug with the current path being restored if it was under the group being deleted with DeleteGroup(); clarify what happens in this case in the docs git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40109 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/confbase.h b/include/wx/confbase.h index e0fcf84ebf..63b755f0f9 100644 --- a/include/wx/confbase.h +++ b/include/wx/confbase.h @@ -293,13 +293,21 @@ private: class WXDLLIMPEXP_BASE wxConfigPathChanger { public: - // ctor/dtor do path changing/restorin + // ctor/dtor do path changing/restoring of the path wxConfigPathChanger(const wxConfigBase *pContainer, const wxString& strEntry); ~wxConfigPathChanger(); // get the key name const wxString& Name() const { return m_strName; } + // this method must be called if the original path (i.e. the current path at + // the moment of creation of this object) could have been deleted to prevent + // us from restoring the not existing (any more) path + // + // if the original path doesn't exist any more, the path will be restored to + // the deepest still existing component of the old path + void UpdateIfDeleted(); + private: wxConfigBase *m_pContainer; // object we live in wxString m_strName, // name of entry (i.e. name only)