mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06: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
1 changed files with 3 additions and 2 deletions
|
@ -97,6 +97,7 @@ class LegacyProfileReader(ProfileReader):
|
||||||
old_setting_expression = dict_of_doom["translation"][new_setting]
|
old_setting_expression = dict_of_doom["translation"][new_setting]
|
||||||
compiled = compile(old_setting_expression, new_setting, "eval")
|
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.
|
new_value = eval(compiled, {"math": math}, legacy_settings) #Pass the legacy settings as local variables to allow access to in the evaluation.
|
||||||
|
if profile.getSettingValue(new_setting) != new_value: #Not equal to the default.
|
||||||
profile.setSettingValue(new_setting, new_value) #Store the setting in the profile!
|
profile.setSettingValue(new_setting, new_value) #Store the setting in the profile!
|
||||||
|
|
||||||
return profile
|
return profile
|
Loading…
Add table
Add a link
Reference in a new issue