]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/config.cpp
have wxbuiltin wxmbconvutf7 return -1 (error) not 0. Some cleanups in string.cpp...
[wxWidgets.git] / src / common / config.cpp
index c75528c66e74f109f6bea39bec423f18559a7a0a..4cc55702a7926d31e046647e3c4587ff6ed33cd8 100644 (file)
@@ -240,15 +240,20 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer,
     strPath = wxCONFIG_PATH_SEPARATOR;
   }
 
-  if ( !strPath.IsEmpty() && m_pContainer->GetPath() != strPath ) {
-    // 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