mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Moved check for top container setting function up in the code
Should improve performance a bit. CURA-2361
This commit is contained in:
parent
642b6b1ca3
commit
75c788c31a
@ -128,6 +128,10 @@ class SettingInheritanceManager(QObject):
|
|||||||
if not self._active_container_stack.getProperty(key, "enabled"):
|
if not self._active_container_stack.getProperty(key, "enabled"):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
## Also check if the top container is not a setting function (this happens if the inheritance is restored).
|
||||||
|
if isinstance(self._active_container_stack.getTop().getProperty(key, "value"), UM.Settings.SettingFunction):
|
||||||
|
return False
|
||||||
|
|
||||||
## Mash all containers for all the stacks together.
|
## Mash all containers for all the stacks together.
|
||||||
while stack:
|
while stack:
|
||||||
containers.extend(stack.getContainers())
|
containers.extend(stack.getContainers())
|
||||||
@ -146,8 +150,7 @@ class SettingInheritanceManager(QObject):
|
|||||||
if has_setting_function:
|
if has_setting_function:
|
||||||
break # There is a setting function somewhere, stop looking deeper.
|
break # There is a setting function somewhere, stop looking deeper.
|
||||||
|
|
||||||
## Also check if the top container is not a setting function (this happens if the inheritance is restored).
|
return has_setting_function and has_non_function_value
|
||||||
return has_setting_function and not isinstance(self._active_container_stack.getTop().getProperty(key, "value"), UM.Settings.SettingFunction) and has_non_function_value
|
|
||||||
|
|
||||||
def _update(self):
|
def _update(self):
|
||||||
self._settings_with_inheritance_warning = [] # Reset previous data.
|
self._settings_with_inheritance_warning = [] # Reset previous data.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user