Fix of 2.3 rc1 can't load its own 3mf files (if they contain custom gcode) #5550

The issue was handling of the special "default_filament_profile" vector,
which is not being normalized in length to the number of extruders,
as this vector is being shown to the user at the Printer dependencies page,
and we don't want to present empty fields there, if the default filament
profile was not defined in the system preset.
This commit is contained in:
Vojtech Bubnik 2021-01-04 11:13:10 +01:00
parent ad2adad434
commit 2d428198b1
3 changed files with 20 additions and 15 deletions

View file

@ -86,9 +86,8 @@ PresetBundle::PresetBundle() :
preset.config.optptr(key, true);
if (i == 0) {
preset.config.optptr("default_print_profile", true);
preset.config.option<ConfigOptionStrings>("default_filament_profile", true)->values = { "" };
}
else {
preset.config.option<ConfigOptionStrings>("default_filament_profile", true);
} else {
preset.config.optptr("default_sla_print_profile", true);
preset.config.optptr("default_sla_material_profile", true);
}
@ -752,7 +751,7 @@ void PresetBundle::load_config_file_config(const std::string &name_or_path, bool
switch (printer_technology) {
case ptFFF:
config.option<ConfigOptionString>("default_print_profile", true);
config.option<ConfigOptionStrings>("default_filament_profile", true)->values.resize(num_extruders, std::string());
config.option<ConfigOptionStrings>("default_filament_profile", true);
break;
case ptSLA:
config.option<ConfigOptionString>("default_sla_print_profile", true);