diff options
author | Arjen Hiemstra <ahiemstra@heimr.nl> | 2016-10-10 14:23:07 +0300 |
---|---|---|
committer | Arjen Hiemstra <ahiemstra@heimr.nl> | 2016-10-10 14:23:43 +0300 |
commit | 68662561e8faae7b45e980e6db5850aae2a13976 (patch) | |
tree | 9f161d8332814aa891148bf8fae8074d6fa38d59 /cura/QualityManager.py | |
parent | fea0dfdfa1b3e4b989d9295d49edd07b65949787 (diff) |
Return empty quality instead of None in QualityManager::findQualityByQualityType
Contributes to CURA-2271
Diffstat (limited to 'cura/QualityManager.py')
-rw-r--r-- | cura/QualityManager.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cura/QualityManager.py b/cura/QualityManager.py index adf2f0423b..6deea4053e 100644 --- a/cura/QualityManager.py +++ b/cura/QualityManager.py @@ -20,6 +20,9 @@ class QualityManager: __instance = None
+ def __init__(self):
+ self._empty_quality_container = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = "empty_quality")[0]
+
## Find a quality by name for a specific machine definition and materials.
#
# \param quality_name
@@ -92,7 +95,8 @@ class QualityManager: if not result and material_containers and len(material_containers) == 1:
basic_materials = self._getBasicMaterials(material_containers[0])
result = self._getFilteredContainersForStack(machine_definition, basic_materials, **criteria)
- return result[0] if result else None
+
+ return result[0] if result else self._empty_quality_container
## Find all suitable qualities for a combination of machine and material.
#
|