Simplify activeQualityOrQualityChangesName

Removed duplicate fallback mechanism if quality is empty. And removed dependency on shadow administration in _current_quality_group.

Contributes to issue CURA-6600.
This commit is contained in:
Ghostkeeper 2019-08-27 11:11:17 +02:00
parent 01796b99cd
commit 78db68369e
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -1547,12 +1547,10 @@ class MachineManager(QObject):
@pyqtProperty(str, notify = activeQualityGroupChanged) @pyqtProperty(str, notify = activeQualityGroupChanged)
def activeQualityOrQualityChangesName(self) -> str: def activeQualityOrQualityChangesName(self) -> str:
name = empty_quality_container.getName() global_container_stack = CuraApplication.getInstance().getGlobalContainerStack()
if self._current_quality_changes_group: if global_container_stack.qualityChanges != CuraApplication.getInstance().empty_quality_changes_container:
name = self._current_quality_changes_group.name return global_container_stack.qualityChanges.getName()
elif self._current_quality_group: return global_container_stack.quality.getName()
name = self._current_quality_group.name
return name
@pyqtProperty(bool, notify = activeQualityGroupChanged) @pyqtProperty(bool, notify = activeQualityGroupChanged)
def hasNotSupportedQuality(self) -> bool: def hasNotSupportedQuality(self) -> bool: