mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 18:45:55 +08:00
Fix for SPE-1271 - The profile is displayed as modified even after reverting all changes
This commit is contained in:
parent
ac36b861f1
commit
c900f2e04f
@ -748,7 +748,7 @@ std::pair<Preset*, bool> PresetCollection::load_external_preset(
|
|||||||
{
|
{
|
||||||
// Load the preset over a default preset, so that the missing fields are filled in from the default preset.
|
// Load the preset over a default preset, so that the missing fields are filled in from the default preset.
|
||||||
DynamicPrintConfig cfg(this->default_preset_for(combined_config).config);
|
DynamicPrintConfig cfg(this->default_preset_for(combined_config).config);
|
||||||
const auto &keys = cfg.keys();
|
t_config_option_keys keys = std::move(cfg.keys());
|
||||||
cfg.apply_only(combined_config, keys, true);
|
cfg.apply_only(combined_config, keys, true);
|
||||||
std::string &inherits = Preset::inherits(cfg);
|
std::string &inherits = Preset::inherits(cfg);
|
||||||
if (select == LoadAndSelect::Never) {
|
if (select == LoadAndSelect::Never) {
|
||||||
@ -792,6 +792,13 @@ std::pair<Preset*, bool> PresetCollection::load_external_preset(
|
|||||||
// the differences will be shown in the preset editor against the referenced profile.
|
// the differences will be shown in the preset editor against the referenced profile.
|
||||||
this->select_preset(it - m_presets.begin());
|
this->select_preset(it - m_presets.begin());
|
||||||
// The source config may contain keys from many possible preset types. Just copy those that relate to this preset.
|
// The source config may contain keys from many possible preset types. Just copy those that relate to this preset.
|
||||||
|
|
||||||
|
// Following keys are not used neither by the UI nor by the slicing core, therefore they are not important
|
||||||
|
// Erase them from config appl to avoid redundant "dirty" parameter in loaded preset.
|
||||||
|
for (const char* key : { "print_settings_id", "filament_settings_id", "sla_print_settings_id", "sla_material_settings_id", "printer_settings_id",
|
||||||
|
"printer_model", "printer_variant", "default_print_profile", "default_filament_profile", "default_sla_print_profile", "default_sla_material_profile" })
|
||||||
|
keys.erase(std::remove(keys.begin(), keys.end(), key), keys.end());
|
||||||
|
|
||||||
this->get_edited_preset().config.apply_only(combined_config, keys, true);
|
this->get_edited_preset().config.apply_only(combined_config, keys, true);
|
||||||
this->update_dirty();
|
this->update_dirty();
|
||||||
// Don't save the newly loaded project as a "saved into project" state.
|
// Don't save the newly loaded project as a "saved into project" state.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user