cfg: per-game settings must be deleted when changed back to standard
When a per-game setting is the same as the standard one, it is ignored and not saved to emu.cfg. However the previously saved per-game setting wasn't deleted, making it impossible to revert. Issue #653
This commit is contained in:
parent
5ae7ac3eca
commit
642fad9a6e
|
@ -119,6 +119,11 @@ void cfgDeleteSection(const std::string& section)
|
|||
cfgdb.delete_section(section);
|
||||
}
|
||||
|
||||
void cfgDeleteEntry(const std::string& section, const std::string& key)
|
||||
{
|
||||
cfgdb.delete_entry(section, key);
|
||||
}
|
||||
|
||||
void cfgSetAutoSave(bool autoSave)
|
||||
{
|
||||
::autoSave = autoSave;
|
||||
|
|
|
@ -19,3 +19,4 @@ bool ParseCommandLine(int argc, char *argv[]);
|
|||
void cfgSetAutoSave(bool autoSave);
|
||||
bool cfgHasSection(const std::string& section);
|
||||
void cfgDeleteSection(const std::string& section);
|
||||
void cfgDeleteEntry(const std::string& section, const std::string& key);
|
||||
|
|
|
@ -142,7 +142,11 @@ public:
|
|||
else if (PerGameOption && settings.hasPerGameConfig())
|
||||
{
|
||||
if (value == doLoad(section, name))
|
||||
{
|
||||
// delete existing per-game option if any
|
||||
cfgDeleteEntry(settings.gameId, section + "." + name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (PerGameOption && settings.hasPerGameConfig())
|
||||
doSave(settings.gameId, section + "." + name);
|
||||
|
|
Loading…
Reference in New Issue