mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-29 05:17:58 +03:00
Read settings.cfg from all active config dirs
This commit is contained in:
parent
5ca56a4f8a
commit
1bcc4a8bcc
6 changed files with 28 additions and 17 deletions
|
@ -9,7 +9,8 @@
|
|||
|
||||
#include <Base64.h>
|
||||
|
||||
void Settings::SettingsFileParser::loadSettingsFile(const std::string& file, CategorySettingValueMap& settings, bool base64Encoded)
|
||||
void Settings::SettingsFileParser::loadSettingsFile(const std::string& file, CategorySettingValueMap& settings,
|
||||
bool base64Encoded, bool overrideExisting)
|
||||
{
|
||||
mFile = file;
|
||||
boost::filesystem::ifstream fstream;
|
||||
|
@ -73,7 +74,9 @@ void Settings::SettingsFileParser::loadSettingsFile(const std::string& file, Cat
|
|||
std::string value = line.substr(valueBegin);
|
||||
Misc::StringUtils::trim(value);
|
||||
|
||||
if (settings.insert(std::make_pair(std::make_pair(currentCategory, setting), value)).second == false)
|
||||
if (overrideExisting)
|
||||
settings[std::make_pair(currentCategory, setting)] = value;
|
||||
else if (settings.insert(std::make_pair(std::make_pair(currentCategory, setting), value)).second == false)
|
||||
fail(std::string("duplicate setting: [" + currentCategory + "] " + setting));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue