fixed bug introduced by last commit: if we don't change the path because it is already correct, we should still change the name we use
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30035 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -240,15 +240,20 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer,
|
|||||||
strPath = wxCONFIG_PATH_SEPARATOR;
|
strPath = wxCONFIG_PATH_SEPARATOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !strPath.IsEmpty() && m_pContainer->GetPath() != strPath ) {
|
if ( !strPath.IsEmpty() )
|
||||||
// do change the path
|
{
|
||||||
m_bChanged = true;
|
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_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 {
|
else {
|
||||||
// it's a name only, without path - nothing to do
|
// it's a name only, without path - nothing to do
|
||||||
|
Reference in New Issue
Block a user