mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-28 13:32:04 +08:00
PresetBundle: Added update of aliases maps after configuration loading,
and not only after loading system presets. Note: Misses update was related to SPE-1947 : Crash when change Print settings_IS XL config bundle
This commit is contained in:
parent
02a2c73ca5
commit
3bb4aaec5a
@ -408,6 +408,11 @@ void PresetBundle::update_system_maps()
|
||||
this->sla_materials.update_map_system_profile_renamed();
|
||||
this->printers .update_map_system_profile_renamed();
|
||||
|
||||
update_alias_maps();
|
||||
}
|
||||
|
||||
void PresetBundle::update_alias_maps()
|
||||
{
|
||||
this->prints .update_map_alias_to_profile_name();
|
||||
this->sla_prints .update_map_alias_to_profile_name();
|
||||
this->filaments .update_map_alias_to_profile_name();
|
||||
@ -1116,6 +1121,8 @@ void PresetBundle::load_config_file_config(const std::string &name_or_path, bool
|
||||
else
|
||||
this->physical_printers.unselect_printer();
|
||||
}
|
||||
|
||||
update_alias_maps();
|
||||
}
|
||||
|
||||
// Load the active configuration of a config bundle from a boost property_tree. This is a private method called from load_config_file.
|
||||
@ -1194,6 +1201,7 @@ ConfigSubstitutions PresetBundle::load_config_file_config_bundle(
|
||||
this->extruders_filaments[i].select_filament(load_one(this->filaments, tmp_bundle.filaments, tmp_bundle.extruders_filaments[i].get_selected_preset_name(), false));
|
||||
|
||||
this->update_compatible(PresetSelectCompatibleType::Never);
|
||||
update_alias_maps();
|
||||
|
||||
sort_remove_duplicates(config_substitutions);
|
||||
return config_substitutions;
|
||||
@ -1683,6 +1691,8 @@ std::pair<PresetsConfigSubstitutions, size_t> PresetBundle::load_configbundle(
|
||||
this->update_compatible(PresetSelectCompatibleType::Never);
|
||||
}
|
||||
|
||||
update_alias_maps();
|
||||
|
||||
return std::make_pair(std::move(substitutions), presets_loaded + ph_printers_loaded);
|
||||
}
|
||||
|
||||
|
@ -179,6 +179,8 @@ private:
|
||||
std::vector<std::string> merge_presets(PresetBundle &&other);
|
||||
// Update renamed_from and alias maps of system profiles.
|
||||
void update_system_maps();
|
||||
// Update alias maps
|
||||
void update_alias_maps();
|
||||
|
||||
// Set the is_visible flag for filaments and sla materials,
|
||||
// apply defaults based on enabled printers when no filaments/materials are installed.
|
||||
|
Loading…
x
Reference in New Issue
Block a user