don't keep a dirty flag in each entry/group, this is totally wasteful as a single flag in wxFileConfig itself is enough; do reset the dirty flag after Flush()ing
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29631 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -126,8 +126,7 @@ public:
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
// ctor that takes an input stream.
|
||||
wxFileConfig(wxInputStream &inStream,
|
||||
wxMBConv& conv = wxConvUTF8);
|
||||
wxFileConfig(wxInputStream &inStream, wxMBConv& conv = wxConvUTF8);
|
||||
#endif // wxUSE_STREAMS
|
||||
|
||||
// dtor will save unsaved data
|
||||
@@ -198,14 +197,20 @@ private:
|
||||
// the same as SetPath("/")
|
||||
void SetRootPath();
|
||||
|
||||
// set/test the dirty flag
|
||||
void SetDirty() { m_isDirty = true; }
|
||||
void ResetDirty() { m_isDirty = false; }
|
||||
bool IsDirty() const { return m_isDirty; }
|
||||
|
||||
|
||||
// member variables
|
||||
// ----------------
|
||||
wxFileConfigLineList *m_linesHead, // head of the linked list
|
||||
*m_linesTail; // tail
|
||||
wxFileConfigLineList *m_linesHead, // head of the linked list
|
||||
*m_linesTail; // tail
|
||||
|
||||
wxString m_strLocalFile, // local file name passed to ctor
|
||||
m_strGlobalFile; // global
|
||||
wxString m_strPath; // current path (not '/' terminated)
|
||||
wxString m_strLocalFile, // local file name passed to ctor
|
||||
m_strGlobalFile; // global
|
||||
wxString m_strPath; // current path (not '/' terminated)
|
||||
|
||||
wxFileConfigGroup *m_pRootGroup, // the top (unnamed) group
|
||||
*m_pCurrentGroup; // the current group
|
||||
@@ -213,10 +218,12 @@ private:
|
||||
wxMBConv &m_conv;
|
||||
|
||||
#ifdef __UNIX__
|
||||
int m_umask; // the umask to use for file creation
|
||||
int m_umask; // the umask to use for file creation
|
||||
#endif // __UNIX__
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxFileConfig)
|
||||
bool m_isDirty; // if true, we have unsaved changes
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxFileConfig)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user