mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 13:46:01 +08:00
CURA-4400 merge two if statements in 1
This commit is contained in:
parent
5135a972a2
commit
0d61b6652c
@ -722,12 +722,9 @@ class MachineManager(QObject):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
old_value = self._global_container_stack.userChanges.getProperty(setting_key, "value")
|
old_value = self._global_container_stack.userChanges.getProperty(setting_key, "value")
|
||||||
if int(old_value) >= extruder_count:
|
if int(old_value) >= extruder_count or not self._global_container_stack.extruders[str(old_value)].isEnabled:
|
||||||
self._global_container_stack.userChanges.removeInstance(setting_key)
|
self._global_container_stack.userChanges.removeInstance(setting_key)
|
||||||
Logger.log("d", "Reset setting [%s] because its old value [%s] is no longer valid", setting_key, old_value)
|
Logger.log("d", "Reset setting [%s] because its old value [%s] is no longer valid", setting_key, old_value)
|
||||||
if not self._global_container_stack.extruders[str(old_value)].isEnabled:
|
|
||||||
self._global_container_stack.userChanges.removeInstance(setting_key)
|
|
||||||
Logger.log("d", "Reset setting [%s] because its old value [%s] is no longer valid (2)", setting_key, old_value)
|
|
||||||
|
|
||||||
## Set the amount of extruders on the active machine (global stack)
|
## Set the amount of extruders on the active machine (global stack)
|
||||||
# \param extruder_count int the number of extruders to set
|
# \param extruder_count int the number of extruders to set
|
||||||
|
Loading…
x
Reference in New Issue
Block a user