mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Duplicate es_systems.xml command label entries are now ignored on application startup
This commit is contained in:
parent
8efc5e9f22
commit
cd3f56af77
|
@ -682,8 +682,21 @@ bool SystemData::loadConfig()
|
||||||
<< name << "\"";
|
<< name << "\"";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
commands.emplace_back(
|
// Skip any duplicate entries (i.e. those with identical labels).
|
||||||
std::make_pair(entry.text().get(), entry.attribute("label").as_string()));
|
bool duplicateLabel {false};
|
||||||
|
for (auto& command : commands) {
|
||||||
|
if (command.second == entry.attribute("label").as_string()) {
|
||||||
|
LOG(LogError)
|
||||||
|
<< "Duplicate command label \"" << entry.attribute("label").as_string()
|
||||||
|
<< "\" defined for system \"" << name << "\", ignoring entry";
|
||||||
|
duplicateLabel = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!duplicateLabel) {
|
||||||
|
commands.emplace_back(
|
||||||
|
std::make_pair(entry.text().get(), entry.attribute("label").as_string()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Platform ID list
|
// Platform ID list
|
||||||
|
|
Loading…
Reference in a new issue