Use pointers inside ini loop to retain references to ini files
This commit is contained in:
parent
22fa199caf
commit
92ad1b9c4d
|
@ -17,10 +17,10 @@ std::vector<GeckoCode> LoadCodes(const IniFile& globalIni, const IniFile& localI
|
|||
{
|
||||
std::vector<GeckoCode> gcodes;
|
||||
|
||||
for (const IniFile& ini : {globalIni, localIni})
|
||||
for (const IniFile* ini : {&globalIni, &localIni})
|
||||
{
|
||||
std::vector<std::string> lines;
|
||||
ini.GetLines("Gecko", &lines, false);
|
||||
ini->GetLines("Gecko", &lines, false);
|
||||
|
||||
GeckoCode gcode;
|
||||
|
||||
|
@ -42,7 +42,7 @@ std::vector<GeckoCode> LoadCodes(const IniFile& globalIni, const IniFile& localI
|
|||
gcodes.push_back(gcode);
|
||||
gcode = GeckoCode();
|
||||
gcode.enabled = (1 == ss.tellg()); // silly
|
||||
gcode.user_defined = (&ini == &localIni);
|
||||
gcode.user_defined = (ini == &localIni);
|
||||
ss.seekg(1, std::ios_base::cur);
|
||||
// read the code 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);
|
||||
}
|
||||
|
||||
ini.GetLines("Gecko_Enabled", &lines, false);
|
||||
ini->GetLines("Gecko_Enabled", &lines, false);
|
||||
|
||||
for (const std::string& line : lines)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue