Fix of prusa 2.3.0 crash with 0.25 nozzle #5825

Importing a config bundle as a config file was broken for
multi material FDM printers, where a different filament was active
for each extruder.
This commit is contained in:
Vojtech Bubnik 2021-01-19 09:58:06 +01:00
parent 1efa129b67
commit 5294a48ee8

View File

@ -928,7 +928,11 @@ void PresetBundle::load_config_file_config_bundle(const std::string &path, const
if (opt_compatible->type() == coStrings) if (opt_compatible->type() == coStrings)
static_cast<ConfigOptionStrings*>(opt_compatible)->values.clear(); static_cast<ConfigOptionStrings*>(opt_compatible)->values.clear();
} }
collection_dst.load_preset(path, preset_name_dst, std::move(preset_src->config), activate).is_external = true; (collection_dst.type() == Preset::TYPE_FILAMENT ?
collection_dst.load_preset(path, preset_name_dst, preset_src->config, activate) :
// Only move the source config for non filament profiles, as single filament profile may be referenced multiple times.
collection_dst.load_preset(path, preset_name_dst, std::move(preset_src->config), activate))
.is_external = true;
return preset_name_dst; return preset_name_dst;
}; };
load_one(this->prints, tmp_bundle.prints, tmp_bundle.prints .get_selected_preset_name(), true); load_one(this->prints, tmp_bundle.prints, tmp_bundle.prints .get_selected_preset_name(), true);