mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 10:47:49 -06:00
getAvailableMaterialsForMachineExtruder can never return None
So no need to check for it. Contributes to issue CURA-6600.
This commit is contained in:
parent
5abb03e269
commit
46b489c3f9
2 changed files with 2 additions and 7 deletions
|
@ -103,7 +103,7 @@ class MaterialManager(QObject):
|
|||
# A convenience function to get available materials for the given machine with the extruder position.
|
||||
#
|
||||
def getAvailableMaterialsForMachineExtruder(self, machine: "GlobalStack",
|
||||
extruder_stack: "ExtruderStack") -> Optional[Dict[str, MaterialNode]]:
|
||||
extruder_stack: "ExtruderStack") -> Dict[str, MaterialNode]:
|
||||
nozzle_name = None
|
||||
if extruder_stack.variant.getId() != "empty_variant":
|
||||
nozzle_name = extruder_stack.variant.getName()
|
||||
|
|
|
@ -106,20 +106,15 @@ class BaseMaterialsModel(ListModel):
|
|||
# so it's placed here for easy access.
|
||||
def _canUpdate(self):
|
||||
global_stack = self._machine_manager.activeMachine
|
||||
|
||||
if global_stack is None or not self._enabled:
|
||||
return False
|
||||
|
||||
extruder_position = str(self._extruder_position)
|
||||
|
||||
if extruder_position not in global_stack.extruders:
|
||||
return False
|
||||
|
||||
extruder_stack = global_stack.extruders[extruder_position]
|
||||
self._available_materials = self._material_manager.getAvailableMaterialsForMachineExtruder(global_stack, extruder_stack)
|
||||
if self._available_materials is None:
|
||||
return False
|
||||
|
||||
self._available_materials = self._material_manager.getAvailableMaterialsForMachineExtruder(global_stack, extruder_stack)
|
||||
return True
|
||||
|
||||
## This is another convenience function which is shared by all material
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue