X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c9d59ee7e0cbe4acae6153adafb5ddce9a4e65dd..fd864f01f2f611a3b30bb261b4edd890f639369a:/src/common/config.cpp diff --git a/src/common/config.cpp b/src/common/config.cpp index 2e8372db93..4cc55702a7 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -75,6 +75,7 @@ wxConfigBase::wxConfigBase(const wxString& appName, wxConfigBase::~wxConfigBase() { + // required here for Darwin } wxConfigBase *wxConfigBase::Set(wxConfigBase *pConfig) @@ -239,15 +240,20 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer, strPath = wxCONFIG_PATH_SEPARATOR; } - if ( !strPath.IsEmpty() ) { - // do change the path - m_bChanged = true; + if ( !strPath.IsEmpty() ) + { + if ( m_pContainer->GetPath() != strPath ) + { + // do change the path + m_bChanged = true; + m_strOldPath = m_pContainer->GetPath(); + if ( *m_strOldPath.c_str() != wxCONFIG_PATH_SEPARATOR ) + m_strOldPath += wxCONFIG_PATH_SEPARATOR; + m_pContainer->SetPath(strPath); + } + + // in any case, use the just the name, not full path m_strName = strEntry.AfterLast(wxCONFIG_PATH_SEPARATOR); - m_strOldPath = m_pContainer->GetPath(); - if ( m_strOldPath.Len() == 0 || - m_strOldPath.Last() != wxCONFIG_PATH_SEPARATOR ) - m_strOldPath += wxCONFIG_PATH_SEPARATOR; - m_pContainer->SetPath(strPath); } else { // it's a name only, without path - nothing to do @@ -352,7 +358,7 @@ wxString wxExpandEnvVars(const wxString& str) // check the closing bracket if ( bracket != Bracket_None ) { - if ( m == str.Len() || str[m] != (char)bracket ) { + if ( m == str.Len() || str[m] != (wxChar)bracket ) { // under MSW it's common to have '%' characters in the registry // and it's annoying to have warnings about them each time, so // ignroe them silently if they are not used for env vars