Save the config file even it does not exist, patch by Vladislav Belov, fixes #4146

This was SVN commit r18960.
This commit is contained in:
mimo 2016-11-18 18:06:01 +00:00
parent b83d5eb63c
commit a3c3ca79cf
2 changed files with 2 additions and 4 deletions

View File

@ -93,8 +93,7 @@ bool L10n::SaveLocale(const Locale& locale) const
return false;
g_ConfigDB.SetValueString(CFG_USER, "locale", locale.getName());
g_ConfigDB.WriteValueToFile(CFG_USER, "locale", locale.getName());
return true;
return g_ConfigDB.WriteValueToFile(CFG_USER, "locale", locale.getName());
}
bool L10n::ValidateLocale(const std::string& localeCode) const

View File

@ -446,8 +446,7 @@ bool CConfigDB::WriteValueToFile(EConfigNamespace ns, const CStr& name, const CS
TConfigMap newMap;
m_Map[ns].swap(newMap);
if (!Reload(ns))
return false;
Reload(ns);
SetValueString(ns, name, value);
bool ret = WriteFile(ns, path);