INISettingsInterface: Add Save() method
This commit is contained in:
parent
ebc3aa118c
commit
674bcdfeec
|
@ -13,11 +13,16 @@ INISettingsInterface::INISettingsInterface(std::string filename) : m_filename(st
|
|||
INISettingsInterface::~INISettingsInterface()
|
||||
{
|
||||
if (m_dirty)
|
||||
{
|
||||
SI_Error err = m_ini.SaveFile(m_filename.c_str(), false);
|
||||
if (err != SI_OK)
|
||||
Log_WarningPrintf("Failed to save settings to '%s'.", m_filename.c_str());
|
||||
}
|
||||
Save();
|
||||
}
|
||||
|
||||
void INISettingsInterface::Save()
|
||||
{
|
||||
SI_Error err = m_ini.SaveFile(m_filename.c_str(), false);
|
||||
if (err != SI_OK)
|
||||
Log_WarningPrintf("Failed to save settings to '%s'.", m_filename.c_str());
|
||||
else
|
||||
m_dirty = false;
|
||||
}
|
||||
|
||||
void INISettingsInterface::Clear()
|
||||
|
|
|
@ -9,6 +9,8 @@ public:
|
|||
INISettingsInterface(std::string filename);
|
||||
~INISettingsInterface();
|
||||
|
||||
void Save();
|
||||
|
||||
void Clear() override;
|
||||
|
||||
int GetIntValue(const char* section, const char* key, int default_value = 0) override;
|
||||
|
|
Loading…
Reference in New Issue