From a130434e56c25aadaf3f25637a14ded282c2b2e0 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 29 Sep 2016 21:35:16 +1000 Subject: [PATCH] [Project64] Add CSettingTypeApplication::ResetAll --- .../SettingType/SettingsType-Application.cpp | 14 ++++++++++++++ .../SettingType/SettingsType-Application.h | 1 + 2 files changed, 15 insertions(+) diff --git a/Source/Project64-core/Settings/SettingType/SettingsType-Application.cpp b/Source/Project64-core/Settings/SettingType/SettingsType-Application.cpp index cd61091bc..3747a3456 100644 --- a/Source/Project64-core/Settings/SettingType/SettingsType-Application.cpp +++ b/Source/Project64-core/Settings/SettingType/SettingsType-Application.cpp @@ -116,6 +116,20 @@ void CSettingTypeApplication::Flush() } } +void CSettingTypeApplication::ResetAll() +{ + if (m_SettingsIniFile == NULL) + { + return; + } + CIniFile::SectionList sections; + m_SettingsIniFile->GetVectorOfSections(sections); + for (size_t i = 0; i < sections.size(); i++) + { + m_SettingsIniFile->DeleteSection(sections[i].c_str()); + } +} + void CSettingTypeApplication::CleanUp() { if (m_SettingsIniFile) diff --git a/Source/Project64-core/Settings/SettingType/SettingsType-Application.h b/Source/Project64-core/Settings/SettingType/SettingsType-Application.h index cb22a5cca..c146dc31f 100644 --- a/Source/Project64-core/Settings/SettingType/SettingsType-Application.h +++ b/Source/Project64-core/Settings/SettingType/SettingsType-Application.h @@ -50,6 +50,7 @@ public: static void Initialize(const char * AppName); static void CleanUp(void); static void Flush(void); + static void ResetAll(void); const char * GetKeyName(void) const { return m_KeyName.c_str(); }