]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxCONFIG_USE_RELATIVE_PATH option to allow relative paths for config files
authorJ. Russell Smyth <drfish@cox.net>
Wed, 5 May 1999 05:01:08 +0000 (05:01 +0000)
committerJ. Russell Smyth <drfish@cox.net>
Wed, 5 May 1999 05:01:08 +0000 (05:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/fileconf.cpp

index 83e3659140b4197e20f31398909a2960c00932f0..5e9762390ca7b8a5c46f90fac874cc052792d4f3 100644 (file)
@@ -226,18 +226,21 @@ wxFileConfig::wxFileConfig(const wxString& appName, const wxString& vendorName,
     SetStyle(GetStyle() | wxCONFIG_USE_GLOBAL_FILE);
 
   // if the path is not absolute, prepend the standard directory to it
-  if ( !m_strLocalFile.IsEmpty() && !wxIsAbsolutePath(m_strLocalFile) )
-  {
-    wxString strLocal = m_strLocalFile;
-    m_strLocalFile = GetLocalDir();
-    m_strLocalFile << strLocal;
-  }
-
-  if ( !m_strGlobalFile.IsEmpty() && !wxIsAbsolutePath(m_strGlobalFile) )
-  {
-    wxString strGlobal = m_strGlobalFile;
-    m_strGlobalFile = GetGlobalDir();
-    m_strGlobalFile << strGlobal;
+  // UNLESS wxCONFIG_USE_RELATIVE_PATH style is set
+  if ( !(style & wxCONFIG_USE_RELATIVE_PATH) ){
+         if ( !m_strLocalFile.IsEmpty() && !wxIsAbsolutePath(m_strLocalFile) )
+         {
+                 wxString strLocal = m_strLocalFile;
+                 m_strLocalFile = GetLocalDir();
+                 m_strLocalFile << strLocal;
+         }
+
+         if ( !m_strGlobalFile.IsEmpty() && !wxIsAbsolutePath(m_strGlobalFile) )
+         {
+                 wxString strGlobal = m_strGlobalFile;
+                 m_strGlobalFile = GetGlobalDir();
+                 m_strGlobalFile << strGlobal;
+         }
   }
 
   Init();