From 5c2bd0b3bb70c04fc4c0511ab5c78b9512c7803b Mon Sep 17 00:00:00 2001 From: joevt Date: Mon, 30 Oct 2023 17:19:45 -0700 Subject: [PATCH] machines: Don't override existing properties. --- machines/machinefactory.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/machines/machinefactory.cpp b/machines/machinefactory.cpp index e59414e..ae1bcbe 100644 --- a/machines/machinefactory.cpp +++ b/machines/machinefactory.cpp @@ -233,10 +233,16 @@ void MachineFactory::get_device_settings(DeviceDescription& dev, mapget_string(); + 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(); - // populate dynamic machine settings from presets - gMachineSettings[p.first] = unique_ptr(p.second->clone()); + // populate dynamic machine settings from presets + gMachineSettings[p.first] = unique_ptr(p.second->clone()); + } } }