GUI: improve system detection algorithm (maybe)
This commit is contained in:
parent
c8612b7e8a
commit
eab679e9d3
5 changed files with 52 additions and 8 deletions
|
|
@ -54,6 +54,10 @@ String DivConfig::toBase64() {
|
|||
return taEncodeBase64(data);
|
||||
}
|
||||
|
||||
const std::map<String,String>& DivConfig::configMap() {
|
||||
return conf;
|
||||
}
|
||||
|
||||
void DivConfig::parseLine(const char* line) {
|
||||
String key="";
|
||||
String value="";
|
||||
|
|
@ -171,6 +175,15 @@ String DivConfig::getString(String key, String fallback) const {
|
|||
return fallback;
|
||||
}
|
||||
|
||||
bool DivConfig::has(String key) {
|
||||
try {
|
||||
conf.at(key);
|
||||
} catch (std::out_of_range& e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void DivConfig::set(String key, bool value) {
|
||||
if (value) {
|
||||
conf[key]="true";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue