Allow disabling saving wxFileConfig data when it is destroyed
This can be useful to avoid saving the changes performed by the user if this turns out to be undesirable, for whatever reason. Closes https://github.com/wxWidgets/wxWidgets/pull/1451 Closes #13788.
This commit is contained in:
committed by
Vadim Zeitlin
parent
e31938c314
commit
c525784f77
@@ -95,6 +95,29 @@ public:
|
||||
*/
|
||||
virtual bool Save(wxOutputStream& os, const wxMBConv& conv = wxConvAuto());
|
||||
|
||||
/**
|
||||
Enables saving data to the disk file when this object is destroyed.
|
||||
|
||||
This is the default behaviour and this function doesn't need to be
|
||||
called explicitly unless DisableAutoSave() had been previously called.
|
||||
|
||||
@since 3.1.3
|
||||
*/
|
||||
void EnableAutoSave();
|
||||
|
||||
/**
|
||||
Prevent this object from saving data to the disk file when it is
|
||||
destroyed.
|
||||
|
||||
By default, changes to this object are only saved permanently when
|
||||
Flush() is explicitly called or when it is destroyed. If this method is
|
||||
called, Flush() won't be called automatically from the destructor,
|
||||
meaning that any non-explicitly-flushed changes will be lost.
|
||||
|
||||
@since 3.1.3
|
||||
*/
|
||||
void DisableAutoSave();
|
||||
|
||||
/**
|
||||
Allows setting the mode to be used for the config file creation. For example, to
|
||||
create a config file which is not readable by other users (useful if it stores
|
||||
|
Reference in New Issue
Block a user