COMMON: Add a helper to update a ConfMan entry and flush to disk
This commit is contained in:
parent
b4e9f6696b
commit
bad365c97e
3 changed files with 20 additions and 6 deletions
|
@ -128,12 +128,7 @@ const String getGameGUIOptionsDescription(const String &options) {
|
|||
|
||||
void updateGameGUIOptions(const String &options, const String &langOption) {
|
||||
const String newOptionString = getGameGUIOptionsDescription(options) + " " + langOption;
|
||||
|
||||
if ((!options.empty() && !ConfMan.hasKey("guioptions")) ||
|
||||
(ConfMan.hasKey("guioptions") && ConfMan.get("guioptions") != newOptionString)) {
|
||||
ConfMan.set("guioptions", newOptionString);
|
||||
ConfMan.flushToDisk();
|
||||
}
|
||||
ConfMan.setAndFlush("guioptions", newOptionString);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue