mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 15:19:00 +08:00
Clarify global container stack checking code in _checkStacksHaveErrors
The order of operations was a bit weird. This made the code unclear and also required an extra check in an if-statement. This is simpler and theoretically even a bit faster. Contributes sorta to issue CURA-3291.
This commit is contained in:
parent
31e88aa5af
commit
7d536e2f8b
@ -381,11 +381,11 @@ class MachineManager(QObject):
|
|||||||
return UM.Settings.ContainerRegistry.getInstance().createUniqueName(container_type, current_name, new_name, fallback_name)
|
return UM.Settings.ContainerRegistry.getInstance().createUniqueName(container_type, current_name, new_name, fallback_name)
|
||||||
|
|
||||||
def _checkStacksHaveErrors(self):
|
def _checkStacksHaveErrors(self):
|
||||||
if self._global_container_stack is not None and self._global_container_stack.hasErrors():
|
if self._global_container_stack is None: #No active machine.
|
||||||
return True
|
|
||||||
|
|
||||||
if self._global_container_stack is None:
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if self._global_container_stack.hasErrors():
|
||||||
|
return True
|
||||||
stacks = list(ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()))
|
stacks = list(ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()))
|
||||||
for stack in stacks:
|
for stack in stacks:
|
||||||
if stack.hasErrors():
|
if stack.hasErrors():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user