Fixed wxConfig (I hope) and disabled wxRegConfig::DeleteAll.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -18,6 +18,7 @@ src/makesc.env
|
|||||||
src/makeg95.env
|
src/makeg95.env
|
||||||
src/makesl.env
|
src/makesl.env
|
||||||
src/makeprog.sl
|
src/makeprog.sl
|
||||||
|
src/salford.lnk
|
||||||
src/ntwxwin.mak
|
src/ntwxwin.mak
|
||||||
src/maketwin.env
|
src/maketwin.env
|
||||||
src/makeprog.twn
|
src/makeprog.twn
|
||||||
|
@@ -204,7 +204,8 @@ void MyFrame::OnDelete(wxCommandEvent&)
|
|||||||
{
|
{
|
||||||
// VZ: it seems that DeleteAll() wreaks havoc on NT. Disabled until I
|
// VZ: it seems that DeleteAll() wreaks havoc on NT. Disabled until I
|
||||||
// investigate it further, do _not_ compile this code in meanwhile!
|
// investigate it further, do _not_ compile this code in meanwhile!
|
||||||
#if 0
|
// JACS: wxRegConfig::DeleteAll is disabled, so it's safe to call DeleteAll,
|
||||||
|
// it just won't do anything useful on Win95/NT.
|
||||||
if ( wxConfigBase::Get()->DeleteAll() ) {
|
if ( wxConfigBase::Get()->DeleteAll() ) {
|
||||||
wxLogMessage("Config file/registry key successfully deleted.");
|
wxLogMessage("Config file/registry key successfully deleted.");
|
||||||
|
|
||||||
@@ -212,7 +213,6 @@ void MyFrame::OnDelete(wxCommandEvent&)
|
|||||||
wxConfigBase::DontCreateOnDemand();
|
wxConfigBase::DontCreateOnDemand();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif // 0
|
|
||||||
wxLogError("Deleting config file/registry key failed.");
|
wxLogError("Deleting config file/registry key failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -226,7 +226,8 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer,
|
|||||||
const wxString& strEntry)
|
const wxString& strEntry)
|
||||||
{
|
{
|
||||||
m_pContainer = (wxConfigBase *)pContainer;
|
m_pContainer = (wxConfigBase *)pContainer;
|
||||||
wxString strPath = strEntry.Before(wxCONFIG_PATH_SEPARATOR);
|
// wxString strPath = strEntry.Before(wxCONFIG_PATH_SEPARATOR);
|
||||||
|
wxString strPath = strEntry.BeforeLast(wxCONFIG_PATH_SEPARATOR);
|
||||||
|
|
||||||
// special case of "/keyname" when there is nothing before "/"
|
// special case of "/keyname" when there is nothing before "/"
|
||||||
if ( strPath.IsEmpty() && ((!strEntry.IsEmpty()) && strEntry[0] == wxCONFIG_PATH_SEPARATOR ))
|
if ( strPath.IsEmpty() && ((!strEntry.IsEmpty()) && strEntry[0] == wxCONFIG_PATH_SEPARATOR ))
|
||||||
@@ -235,7 +236,8 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer,
|
|||||||
if ( !strPath.IsEmpty() ) {
|
if ( !strPath.IsEmpty() ) {
|
||||||
// do change the path
|
// do change the path
|
||||||
m_bChanged = TRUE;
|
m_bChanged = TRUE;
|
||||||
m_strName = strEntry.Right(wxCONFIG_PATH_SEPARATOR);
|
// m_strName = strEntry.Right(wxCONFIG_PATH_SEPARATOR);
|
||||||
|
m_strName = strEntry.AfterLast(wxCONFIG_PATH_SEPARATOR);
|
||||||
m_strOldPath = m_pContainer->GetPath();
|
m_strOldPath = m_pContainer->GetPath();
|
||||||
m_strOldPath += wxCONFIG_PATH_SEPARATOR;
|
m_strOldPath += wxCONFIG_PATH_SEPARATOR;
|
||||||
m_pContainer->SetPath(strPath);
|
m_pContainer->SetPath(strPath);
|
||||||
|
@@ -467,12 +467,16 @@ bool wxRegConfig::DeleteAll()
|
|||||||
{
|
{
|
||||||
m_keyLocal.Close();
|
m_keyLocal.Close();
|
||||||
m_keyGlobal.Close();
|
m_keyGlobal.Close();
|
||||||
|
#if 1
|
||||||
|
wxFAIL_MSG("wxRegConfig::DeleteAll will wipe out your entire registry, so please do not use until it's fixed!");
|
||||||
|
return FALSE;
|
||||||
|
#else
|
||||||
bool bOk = m_keyLocalRoot.DeleteSelf();
|
bool bOk = m_keyLocalRoot.DeleteSelf();
|
||||||
if ( bOk )
|
if ( bOk )
|
||||||
bOk = m_keyGlobalRoot.DeleteSelf();
|
bOk = m_keyGlobalRoot.DeleteSelf();
|
||||||
|
|
||||||
return bOk;
|
return bOk;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user