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:
Ghostkeeper 2016-01-13 16:16:00 +01:00
parent 3195684892
commit 5d4cceb47c

View file

@ -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