mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 06:33:55 -06:00
Use parseBool() for metadata bool values
CURA-4482
This commit is contained in:
parent
9b102f9a7e
commit
e246784df2
1 changed files with 4 additions and 6 deletions
|
@ -1175,15 +1175,14 @@ class MachineManager(QObject):
|
|||
@pyqtProperty(bool, notify = globalContainerChanged)
|
||||
def hasMaterials(self) -> bool:
|
||||
if self._global_container_stack:
|
||||
return bool(self._global_container_stack.getMetaDataEntry("has_materials", False))
|
||||
return Util.parseBool(self._global_container_stack.getMetaDataEntry("has_materials", False))
|
||||
|
||||
return False
|
||||
|
||||
@pyqtProperty(bool, notify = globalContainerChanged)
|
||||
def hasVariants(self) -> bool:
|
||||
if self._global_container_stack:
|
||||
return bool(self._global_container_stack.getMetaDataEntry("has_variants", False))
|
||||
|
||||
return Util.parseBool(self._global_container_stack.getMetaDataEntry("has_variants", False))
|
||||
return False
|
||||
|
||||
## Property to indicate if a machine has "specialized" material profiles.
|
||||
|
@ -1191,8 +1190,7 @@ class MachineManager(QObject):
|
|||
@pyqtProperty(bool, notify = globalContainerChanged)
|
||||
def filterMaterialsByMachine(self) -> bool:
|
||||
if self._global_container_stack:
|
||||
return bool(self._global_container_stack.getMetaDataEntry("has_machine_materials", False))
|
||||
|
||||
return Util.parseBool(self._global_container_stack.getMetaDataEntry("has_machine_materials", False))
|
||||
return False
|
||||
|
||||
## Property to indicate if a machine has "specialized" quality profiles.
|
||||
|
@ -1200,7 +1198,7 @@ class MachineManager(QObject):
|
|||
@pyqtProperty(bool, notify = globalContainerChanged)
|
||||
def filterQualityByMachine(self) -> bool:
|
||||
if self._global_container_stack:
|
||||
return bool(self._global_container_stack.getMetaDataEntry("has_machine_quality", False))
|
||||
return Util.parseBool(self._global_container_stack.getMetaDataEntry("has_machine_quality", False))
|
||||
return False
|
||||
|
||||
## Get the Definition ID of a machine (specified by ID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue