Wxwidgets: Don't save or load blank core preferences
This commit is contained in:
parent
3917c41b6b
commit
cf365d181e
1 changed files with 6 additions and 3 deletions
|
@ -243,8 +243,10 @@ end:
|
||||||
} else
|
} else
|
||||||
button_keys[r[2]] = r[1];
|
button_keys[r[2]] = r[1];
|
||||||
} else if(r = regex("PREFER[ \t]+([^ \t]+)[ \t]+(.*)", line)) {
|
} else if(r = regex("PREFER[ \t]+([^ \t]+)[ \t]+(.*)", line)) {
|
||||||
|
if(r[2] != "") {
|
||||||
core_selections[r[1]] = r[2];
|
core_selections[r[1]] = r[2];
|
||||||
messages << "Prefer " << r[2] << " for " << r[1] << std::endl;
|
messages << "Prefer " << r[2] << " for " << r[1] << std::endl;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
messages << "Unrecognized directive: " << line << std::endl;
|
messages << "Unrecognized directive: " << line << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -313,6 +315,7 @@ end:
|
||||||
for(auto i : button_keys)
|
for(auto i : button_keys)
|
||||||
cfgfile << "BUTTON " << i.second << " " << i.first << std::endl;
|
cfgfile << "BUTTON " << i.second << " " << i.first << std::endl;
|
||||||
for(auto i : core_selections)
|
for(auto i : core_selections)
|
||||||
|
if(i.second != "")
|
||||||
cfgfile << "PREFER " << i.first << " " << i.second << std::endl;
|
cfgfile << "PREFER " << i.first << " " << i.second << std::endl;
|
||||||
//Last save.
|
//Last save.
|
||||||
std::ofstream lsave(get_config_path() + "/" + our_rom_name + ".ls");
|
std::ofstream lsave(get_config_path() + "/" + our_rom_name + ".ls");
|
||||||
|
|
Loading…
Add table
Reference in a new issue