X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7af61b2e180b95f0009e41a5c2c09006d5077e9c..837e57436a89516a5fa9f478f401e06bd872c17c:/src/common/fileconf.cpp diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 83e3659140..231c156482 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -21,12 +21,15 @@ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- + #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif //__BORLANDC__ +#if wxUSE_CONFIG + #ifndef WX_PRECOMP #include "wx/string.h" #include "wx/intl.h" @@ -226,18 +229,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(); @@ -338,7 +344,7 @@ void wxFileConfig::Parse(wxTextFile& file, bool bLocal) } else { // a key const wxChar *pEnd = pStart; - while ( !wxIsspace(*pEnd) ) { + while ( *pEnd != _T('=') && !wxIsspace(*pEnd) ) { if ( *pEnd == _T('\\') ) { // next character may be space or not - still take it because it's // quoted @@ -1274,7 +1280,7 @@ void ConfigEntry::SetValue(const wxString& strValue, bool bUser) if ( bUser ) { wxString strVal = FilterOutValue(strValue); wxString strLine; - strLine << FilterOutEntryName(m_strName) << _T(" = ") << strVal; + strLine << FilterOutEntryName(m_strName) << _T('=') << strVal; if ( m_pLine != NULL ) { // entry was read from the local config file, just modify the line @@ -1480,3 +1486,6 @@ static wxString GetAppName(const wxString& appName) else return appName; } + +#endif // wxUSE_CONFIG +