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() bool Launcher::MainDialog::setupLauncherSettings()
{ {
mLauncherSettings.clear();
mLauncherSettings.setMultiValueEnabled(true); mLauncherSettings.setMultiValueEnabled(true);
QString userPath = QString::fromUtf8(mCfgMgr.getUserConfigPath().string().c_str()); QString userPath = QString::fromUtf8(mCfgMgr.getUserConfigPath().string().c_str());
@ -289,6 +291,8 @@ bool Launcher::MainDialog::setupLauncherSettings()
bool Launcher::MainDialog::setupGameSettings() bool Launcher::MainDialog::setupGameSettings()
{ {
mGameSettings.clear();
QString userPath = QString::fromUtf8(mCfgMgr.getUserConfigPath().string().c_str()); QString userPath = QString::fromUtf8(mCfgMgr.getUserConfigPath().string().c_str());
QString globalPath = QString::fromUtf8(mCfgMgr.getGlobalPath().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)); 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); void setContentList(const QStringList& fileNames);
QStringList getContentList() const; QStringList getContentList() const;
void clear();
private: private:
Files::ConfigurationManager &mCfgMgr; Files::ConfigurationManager &mCfgMgr;

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

Loading…
Cancel
Save