From 22110e15c8c76294068d9a86d322005cb6241d55 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Wed, 24 Oct 2018 14:45:22 +0200 Subject: [PATCH] Fixed spurious error reports when loading the default profile file on start of the application. --- src/slic3r/GUI/PresetBundle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/PresetBundle.cpp b/src/slic3r/GUI/PresetBundle.cpp index 8d4ab194a..f0f53ff6c 100644 --- a/src/slic3r/GUI/PresetBundle.cpp +++ b/src/slic3r/GUI/PresetBundle.cpp @@ -78,7 +78,8 @@ PresetBundle::PresetBundle() : this->printers.add_default_preset(Preset::sla_printer_options(), static_cast(SLAFullPrintConfig::defaults()), "- default SLA -"); this->printers.preset(1).printer_technology() = ptSLA; for (size_t i = 0; i < 2; ++ i) { - Preset &preset = this->printers.preset(i); + // The following ugly switch is to avoid printers.preset(0) to return the edited instance, as the 0th default is the current one. + Preset &preset = (i == 0) ? this->printers.default_preset() : this->printers.preset(1); preset.config.optptr("printer_settings_id", true); preset.config.optptr("printer_vendor", true); preset.config.optptr("printer_model", true);