X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d20d5ee85827d5b7d45d4e4bc1f24dc10839ee8d..ecac22d09ac08cec393b22464b24ae04feb98f6f:/src/common/fileconf.cpp diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 00ab5bf924..c229f690a6 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -5,7 +5,7 @@ // Modified by: // Created: 07.04.98 (adapted from appconf.cpp) // RCS-ID: $Id$ -// Copyright: (c) 1997 Karsten Ballüder & Vadim Zeitlin +// Copyright: (c) 1997 Karsten Ballueder & Vadim Zeitlin // Ballueder@usa.net // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -46,10 +46,6 @@ #include "wx/stdpaths.h" -#if defined(__WXMAC__) - #include "wx/mac/private.h" // includes mac headers -#endif - #if defined(__WXMSW__) #include "wx/msw/private.h" #endif //windows.h @@ -245,6 +241,7 @@ public: // get the last line belonging to an entry/subgroup of this group wxFileConfigLineList *GetGroupLine(); // line which contains [group] + // may be NULL for "/" only wxFileConfigLineList *GetLastEntryLine(); // after which our subgroups start wxFileConfigLineList *GetLastGroupLine(); // after which the next group starts @@ -277,9 +274,9 @@ static void AddConfFileExtIfNeeded(wxFileName& fn) #if defined( __WXMAC__ ) fn.SetName(fn.GetName() + wxT(" Preferences")); #elif defined( __UNIX__ ) - fn.SetExt(wxT(".conf")); + fn.SetExt(wxT("conf")); #else // Windows - fn.SetExt(wxT(".ini")); + fn.SetExt(wxT("ini")); #endif // UNIX/Win } } @@ -550,16 +547,8 @@ void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal) // add the line to linked list if ( bLocal ) - { LineListAppend(strLine); - // let the root group have its start line as well - if ( !n ) - { - m_pCurrentGroup->SetLine(m_linesTail); - } - } - // skip leading spaces for ( pStart = buf; wxIsspace(*pStart); pStart++ ) @@ -958,8 +947,8 @@ bool wxFileConfig::DoWriteString(const wxString& key, const wxString& szValue) SetDirty(); - // this will add a line for this group if it didn't have it before - + // this will add a line for this group if it didn't have it before (or + // do nothing for the root but it's ok as it always exists anyhow) (void)m_pCurrentGroup->GetGroupLine(); } else @@ -1319,9 +1308,6 @@ void wxFileConfig::LineListRemove(wxFileConfigLineList *pLine) else pNext->SetPrev(pPrev); - if ( m_pRootGroup->GetGroupLine() == pLine ) - m_pRootGroup->SetLine(m_linesHead); - wxLogTrace( FILECONF_TRACE_MASK, _T(" head: %s"), ((m_linesHead) ? (const wxChar*)m_linesHead->Text().c_str()