1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-03 17:37:18 +00:00

Fix 'duplicate setting' errors when running installation wizard

This commit is contained in:
scrawl 2015-11-27 20:32:45 +01:00
parent 89783e047b
commit ace4cfc0a8
3 changed files with 13 additions and 0 deletions

View File

@ -384,6 +384,9 @@ bool Launcher::MainDialog::setupGraphicsSettings()
// remain consistent, and possibly be merged into a shared component. At the very least
// the filenames should be in the CfgMgr component.
// Ensure to clear previous settings in case we had already loaded settings.
mEngineSettings.clear();
// Create the settings manager and load default settings file
const std::string localDefault = (mCfgMgr.getLocalPath() / "settings-default.cfg").string();
const std::string globalDefault = (mCfgMgr.getGlobalPath() / "settings-default.cfg").string();

View File

@ -353,6 +353,13 @@ private:
int mLine;
};
void Manager::clear()
{
mDefaultSettings.clear();
mUserSettings.clear();
mChangedSettings.clear();
}
void Manager::loadDefault(const std::string &file)
{
SettingsFileParser parser;

View File

@ -23,6 +23,9 @@ namespace Settings
static CategorySettingVector mChangedSettings;
///< tracks all the settings that were changed since the last apply() call
void clear();
///< clears all settings and default settings
void loadDefault (const std::string& file);
///< load file as the default settings (can be overridden by user settings)