From f8fea1b21595808d04109c0ecb66e3e5b954d2d0 Mon Sep 17 00:00:00 2001 From: Albert Liu <45282415+ggrtk@users.noreply.github.com> Date: Wed, 27 May 2020 16:36:41 -0700 Subject: [PATCH] INISettingsInterface: Return bool on saving settings --- src/frontend-common/ini_settings_interface.cpp | 10 +++++++--- src/frontend-common/ini_settings_interface.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/frontend-common/ini_settings_interface.cpp b/src/frontend-common/ini_settings_interface.cpp index 24f7a14bf..5c1daebea 100644 --- a/src/frontend-common/ini_settings_interface.cpp +++ b/src/frontend-common/ini_settings_interface.cpp @@ -16,13 +16,17 @@ INISettingsInterface::~INISettingsInterface() Save(); } -void INISettingsInterface::Save() +bool 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; + return false; + } + + m_dirty = false; + return true; } void INISettingsInterface::Clear() diff --git a/src/frontend-common/ini_settings_interface.h b/src/frontend-common/ini_settings_interface.h index 88dac946f..592c99d75 100644 --- a/src/frontend-common/ini_settings_interface.h +++ b/src/frontend-common/ini_settings_interface.h @@ -9,7 +9,7 @@ public: INISettingsInterface(std::string filename); ~INISettingsInterface(); - void Save(); + bool Save(); void Clear() override;