logic: Application settings migration system

* Added version number to ApplicationSettings
* Added SettingsMigrator for defining migration rules for different ApplicationSettings versions
* Migrate ApplicationSettings when loading
This commit is contained in:
Eberhard Graether
2016-08-25 12:40:54 +02:00
parent cc8ea7c8fb
commit 03bbce45c9
13 changed files with 489 additions and 23 deletions
+5
View File
@@ -220,6 +220,11 @@ void ConfigManager::setValues(const std::string& key, const std::vector<bool>& v
setValues(key, stringValues);
}
void ConfigManager::removeValues(const std::string& key)
{
m_values.erase(key);
}
bool ConfigManager::isValueDefined(const std::string& key) const
{
std::multimap<std::string, std::string>::const_iterator it = m_values.find(key);
+2
View File
@@ -38,6 +38,8 @@ public:
void setValues(const std::string& key, const std::vector<float>& values);
void setValues(const std::string& key, const std::vector<bool>& values);
void removeValues(const std::string& key);
bool isValueDefined(const std::string& key) const;
bool load(const std::shared_ptr<TextAccess> textAccess);