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()
|
INISettingsInterface::~INISettingsInterface()
|
||||||
{
|
{
|
||||||
if (m_dirty)
|
if (m_dirty)
|
||||||
{
|
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());
|
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()
|
void INISettingsInterface::Clear()
|
||||||
|
|
|
@ -9,6 +9,8 @@ public:
|
||||||
INISettingsInterface(std::string filename);
|
INISettingsInterface(std::string filename);
|
||||||
~INISettingsInterface();
|
~INISettingsInterface();
|
||||||
|
|
||||||
|
void Save();
|
||||||
|
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
int GetIntValue(const char* section, const char* key, int default_value = 0) override;
|
int GetIntValue(const char* section, const char* key, int default_value = 0) override;
|
||||||
|
|
Loading…
Reference in New Issue