From 8c166ea7708438bf8c55233eaa6bbb7bb502f64e Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 22 May 2017 12:58:15 +0200 Subject: [PATCH] Use CuraContainerStack.definition instead of ContainerStack.getBottom() We know now that it must be a Cura Container Stack. This should be a bit faster, and makes the error message I was getting a bit more clear. Contributes to issue CURA-3803. --- cura/Settings/SettingInheritanceManager.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cura/Settings/SettingInheritanceManager.py b/cura/Settings/SettingInheritanceManager.py index 7e9bc2aa0e..d3a1655889 100644 --- a/cura/Settings/SettingInheritanceManager.py +++ b/cura/Settings/SettingInheritanceManager.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Ultimaker B.V. +# Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal @@ -35,7 +35,7 @@ class SettingInheritanceManager(QObject): ## Get the keys of all children settings with an override. @pyqtSlot(str, result = "QStringList") def getChildrenKeysWithOverride(self, key): - definitions = self._global_container_stack.getBottom().findDefinitions(key=key) + definitions = self._global_container_stack.definition.findDefinitions(key=key) if not definitions: Logger.log("w", "Could not find definition for key [%s]", key) return [] @@ -55,7 +55,7 @@ class SettingInheritanceManager(QObject): Logger.log("w", "Unable to find extruder for current machine with index %s", extruder_index) return [] - definitions = self._global_container_stack.getBottom().findDefinitions(key=key) + definitions = self._global_container_stack.definition.findDefinitions(key=key) if not definitions: Logger.log("w", "Could not find definition for key [%s] (2)", key) return [] @@ -93,7 +93,7 @@ class SettingInheritanceManager(QObject): def _onPropertyChanged(self, key, property_name): if (property_name == "value" or property_name == "enabled") and self._global_container_stack: - definitions = self._global_container_stack.getBottom().findDefinitions(key = key) + definitions = self._global_container_stack.definition.findDefinitions(key = key) if not definitions: return @@ -209,7 +209,7 @@ class SettingInheritanceManager(QObject): self._settings_with_inheritance_warning.append(setting_key) # Check all the categories if any of their children have their inheritance overwritten. - for category in self._global_container_stack.getBottom().findDefinitions(type = "category"): + for category in self._global_container_stack.definition.findDefinitions(type = "category"): if self._recursiveCheck(category): self._settings_with_inheritance_warning.append(category.key)