Prevent accessing private _instances variable

We can get at this via the getProperty function.

Contributes to issue CURA-5330.
This commit is contained in:
Ghostkeeper 2018-06-15 10:59:41 +02:00
parent 01a645e726
commit 4418cf3aac
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -22,7 +22,7 @@ class PerObjectContainerStack(CuraContainerStack):
# Return the user defined value if present, otherwise, evaluate the value according to the default routine.
if self.getContainer(0).hasProperty(key, property_name):
if self.getContainer(0)._instances[key].state == InstanceState.User:
if self.getContainer(0).getProperty(key, "state") == InstanceState.User:
result = super().getProperty(key, property_name, context)
context.popContainer()
return result
@ -59,9 +59,9 @@ class PerObjectContainerStack(CuraContainerStack):
super().setNextStack(stack)
# trigger signal to re-evaluate all default settings
for key, instance in self.getContainer(0)._instances.items():
for key in self.getContainer(0).getAllKeys():
# only evaluate default settings
if instance.state != InstanceState.Default:
if self.getContainer(0).getProperty(key, "state") != InstanceState.Default:
continue
self._collectPropertyChanges(key, "value")