X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e9c4c02c19c11e6cd487e03e0a7b105d0281fd7e..ef70f0ecdbc4268923e132b257c95e8a2525f4ca:/src/msw/regconf.cpp diff --git a/src/msw/regconf.cpp b/src/msw/regconf.cpp index fefb7b86c9..2fa8685006 100644 --- a/src/msw/regconf.cpp +++ b/src/msw/regconf.cpp @@ -309,8 +309,12 @@ void wxRegConfig::SetPath(const wxString& strPath) totalSlashes++; } - //else: nothing to do, we squeeze several subseuquent - // slashes into one + else // previous char was a slash too + { + // squeeze several subsequent slashes into one: i.e. + // just ignore this one + dst--; + } } } else // normal character @@ -695,34 +699,7 @@ bool wxRegConfig::RenameEntry(const wxString& oldName, const wxString& newName) if ( HasEntry(newName) ) return FALSE; - // delete the old entry and create the new one - but do in the reverse - // order to not lose the data if Create() fails - - bool ok; - if ( m_keyLocal.IsNumericValue(oldName) ) - { - long val; - ok = m_keyLocal.QueryValue(oldName, &val) && - m_keyLocal.SetValue(newName, val); - } - else - { - wxString val; - ok = m_keyLocal.QueryValue(oldName, val) && - m_keyLocal.SetValue(newName, val); - } - - if ( !ok ) - return FALSE; - - if ( !m_keyLocal.DeleteValue(oldName) ) - { - m_keyLocal.DeleteValue(newName); - - return FALSE; - } - - return TRUE; + return m_keyLocal.RenameValue(oldName, newName); } bool wxRegConfig::RenameGroup(const wxString& oldName, const wxString& newName) @@ -735,11 +712,7 @@ bool wxRegConfig::RenameGroup(const wxString& oldName, const wxString& newName) if ( HasGroup(newName) ) return FALSE; - // TODO there is no way to rename a registry key - we must do a deep copy - // ourselves - wxFAIL_MSG(wxT("Registry key renaming not implemented")); - - return FALSE; + return wxRegKey(m_keyLocal, oldName).Rename(newName); } // ----------------------------------------------------------------------------