Let _fetchInstanceContainers return containers split by loaded or not

It must now return two dictionaries: One for the profiles that have been completely loaded and one for the profiles that are only metadata. We could probably improve on these a little bit, since all of these (except the material model) will now load all available quality profiles. I'll see if it is necessary to optimise that.

Contributes to issue CURA-4243.
This commit is contained in:
Ghostkeeper 2017-11-28 14:26:14 +01:00
parent e5427eded6
commit eb3981b4e0
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
3 changed files with 17 additions and 15 deletions

View file

@ -53,7 +53,7 @@ class ProfilesModel(InstanceContainersModel):
def _fetchInstanceContainers(self):
global_container_stack = Application.getInstance().getGlobalContainerStack()
if global_container_stack is None:
return []
return {}, {}
global_stack_definition = global_container_stack.getBottom()
# Get the list of extruders and place the selected extruder at the front of the list.
@ -83,7 +83,7 @@ class ProfilesModel(InstanceContainersModel):
if quality.getMetaDataEntry("quality_type") not in quality_type_set:
result.append(quality)
return result
return {item.getId():item for item in result}, {}
## Re-computes the items in this model, and adds the layer height role.
def _recomputeItems(self):