mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 18:23:12 +08:00
Don't add a setting if it's the default
If the imported setting is the default in the new Cura, don't add it to the profile. Contributes to issue CURA-37.
This commit is contained in:
parent
3195684892
commit
5d4cceb47c
@ -97,6 +97,7 @@ class LegacyProfileReader(ProfileReader):
|
||||
old_setting_expression = dict_of_doom["translation"][new_setting]
|
||||
compiled = compile(old_setting_expression, new_setting, "eval")
|
||||
new_value = eval(compiled, {"math": math}, legacy_settings) #Pass the legacy settings as local variables to allow access to in the evaluation.
|
||||
profile.setSettingValue(new_setting, new_value) #Store the setting in the profile!
|
||||
if profile.getSettingValue(new_setting) != new_value: #Not equal to the default.
|
||||
profile.setSettingValue(new_setting, new_value) #Store the setting in the profile!
|
||||
|
||||
return profile
|
Loading…
x
Reference in New Issue
Block a user