machines: Don't override existing properties.

This commit is contained in:
joevt 2023-10-30 17:19:45 -07:00 committed by dingusdev
parent d0a5a1e7be
commit 5c2bd0b3bb

View File

@ -233,11 +233,17 @@ void MachineFactory::get_device_settings(DeviceDescription& dev, map<string, str
} }
for (auto& p : dev.properties) { for (auto& p : dev.properties) {
if (settings.count(p.first)) {
// This is a hack. Need to implement hierarchical paths and per device properties.
LOG_F(ERROR, "Duplicate setting \"%s\".", p.first.c_str());
}
else {
settings[p.first] = p.second->get_string(); settings[p.first] = p.second->get_string();
// populate dynamic machine settings from presets // populate dynamic machine settings from presets
gMachineSettings[p.first] = unique_ptr<BasicProperty>(p.second->clone()); gMachineSettings[p.first] = unique_ptr<BasicProperty>(p.second->clone());
} }
}
} }
int MachineFactory::get_machine_settings(const string& id, map<string, string> &settings) int MachineFactory::get_machine_settings(const string& id, map<string, string> &settings)