diff --git a/platform/settings.cpp b/platform/settings.cpp index 3cbf97ca72..b86a306527 100644 --- a/platform/settings.cpp +++ b/platform/settings.cpp @@ -83,6 +83,13 @@ namespace Settings return inst; } + void StringStorage::Clear() + { + lock_guard guard(m_mutex); + m_values.clear(); + Save(); + } + bool StringStorage::GetValue(string const & key, string & outValue) const { lock_guard guard(m_mutex); diff --git a/platform/settings.hpp b/platform/settings.hpp index 9d8c805991..79437d76b1 100644 --- a/platform/settings.hpp +++ b/platform/settings.hpp @@ -22,6 +22,7 @@ namespace Settings public: static StringStorage & Instance(); + void Clear(); bool GetValue(string const & key, string & outValue) const; void SetValue(string const & key, string && value); void DeleteKeyAndValue(string const & key); @@ -46,6 +47,11 @@ namespace Settings StringStorage::Instance().DeleteKeyAndValue(key); } + inline void Clear() + { + StringStorage::Instance().Clear(); + } + enum Units { Metric = 0, Foot }; /// Use this function for running some stuff once according to date.