Use ContainerTree structure to get quality groups

Contributes to issue CURA-6600.
This commit is contained in:
Ghostkeeper 2019-08-15 16:58:57 +02:00
parent 9bcd3d8c1e
commit 606bef9b5f
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -4,6 +4,7 @@
from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal, pyqtSlot
from typing import Any, Dict, List, Optional, Set, Tuple, TYPE_CHECKING
import cura.CuraApplication
from cura.Machines.ContainerTree import ContainerTree
from cura.Settings.cura_empty_instance_containers import empty_intent_container
from UM.Settings.InstanceContainer import InstanceContainer
@ -75,7 +76,8 @@ class IntentManager(QObject):
# TODO: We now do this (return a default) if the global stack is missing, but not in the code below,
# even though there should always be defaults. The problem then is what to do with the quality_types.
# Currently _also_ inconsistent with 'currentAvailableIntentCategories', which _does_ return default.
quality_groups = application.getQualityManager().getQualityGroups(global_stack)
quality_groups = ContainerTree.getInstance().getCurrentQualityGroups()
# TODO: These quality nodes in that tree already contain the intent nodes. We can optimise this.
available_quality_types = {quality_group.quality_type for quality_group in quality_groups.values() if quality_group.node_for_global is not None}
final_intent_ids = set() # type: Set[str]