Merge pull request #5192 from vtj/geckofix

Fix disappearing gecko codes
This commit is contained in:
Mat M 2017-04-01 18:01:28 -04:00 committed by GitHub
commit a65a176777
1 changed files with 4 additions and 4 deletions

View File

@ -17,10 +17,10 @@ std::vector<GeckoCode> LoadCodes(const IniFile& globalIni, const IniFile& localI
{ {
std::vector<GeckoCode> gcodes; std::vector<GeckoCode> gcodes;
for (const IniFile& ini : {globalIni, localIni}) for (const IniFile* ini : {&globalIni, &localIni})
{ {
std::vector<std::string> lines; std::vector<std::string> lines;
ini.GetLines("Gecko", &lines, false); ini->GetLines("Gecko", &lines, false);
GeckoCode gcode; GeckoCode gcode;
@ -42,7 +42,7 @@ std::vector<GeckoCode> LoadCodes(const IniFile& globalIni, const IniFile& localI
gcodes.push_back(gcode); gcodes.push_back(gcode);
gcode = GeckoCode(); gcode = GeckoCode();
gcode.enabled = (1 == ss.tellg()); // silly gcode.enabled = (1 == ss.tellg()); // silly
gcode.user_defined = (&ini == &localIni); gcode.user_defined = (ini == &localIni);
ss.seekg(1, std::ios_base::cur); ss.seekg(1, std::ios_base::cur);
// read the code name // read the code name
std::getline(ss, gcode.name, '['); // stop at [ character (beginning of contributor name) std::getline(ss, gcode.name, '['); // stop at [ character (beginning of contributor name)
@ -75,7 +75,7 @@ std::vector<GeckoCode> LoadCodes(const IniFile& globalIni, const IniFile& localI
gcodes.push_back(gcode); gcodes.push_back(gcode);
} }
ini.GetLines("Gecko_Enabled", &lines, false); ini->GetLines("Gecko_Enabled", &lines, false);
for (const std::string& line : lines) for (const std::string& line : lines)
{ {