Launcher: ensure to clear previous settings when reloading settings

openmw-38
scrawl 9 years ago
parent ace4cfc0a8
commit 177a6f4a68

@ -257,6 +257,8 @@ void Launcher::MainDialog::changePage(QListWidgetItem *current, QListWidgetItem
bool Launcher::MainDialog::setupLauncherSettings()
{
mLauncherSettings.clear();
mLauncherSettings.setMultiValueEnabled(true);
QString userPath = QString::fromUtf8(mCfgMgr.getUserConfigPath().string().c_str());
@ -289,6 +291,8 @@ bool Launcher::MainDialog::setupLauncherSettings()
bool Launcher::MainDialog::setupGameSettings()
{
mGameSettings.clear();
QString userPath = QString::fromUtf8(mCfgMgr.getUserConfigPath().string().c_str());
QString globalPath = QString::fromUtf8(mCfgMgr.getGlobalPath().string().c_str());

@ -454,3 +454,11 @@ QStringList Config::GameSettings::getContentList() const
return Config::LauncherSettings::reverse(values(sContentKey));
}
void Config::GameSettings::clear()
{
mSettings.clear();
mUserSettings.clear();
mDataDirs.clear();
mDataLocal.clear();
}

@ -72,6 +72,8 @@ namespace Config
void setContentList(const QStringList& fileNames);
QStringList getContentList() const;
void clear();
private:
Files::ConfigurationManager &mCfgMgr;

@ -101,6 +101,11 @@ namespace Config
return true;
}
void clear()
{
mSettings.clear();
}
private:
Map mSettings;

Loading…
Cancel
Save