mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 08:47:50 -06:00
Make extra sure cache is emptied when objects get altered.
See the (new) cachePerInstance decorator in UM/Decorators, and the accompanying CachedMemberFunction handler-class. part of CURA-11761
This commit is contained in:
parent
f8aa923ce0
commit
d0252554c4
3 changed files with 10 additions and 2 deletions
|
@ -5,7 +5,7 @@ from typing import Any, Dict, TYPE_CHECKING, Optional
|
|||
|
||||
from PyQt6.QtCore import pyqtProperty, pyqtSignal
|
||||
|
||||
from UM.Decorators import override
|
||||
from UM.Decorators import CachedMemberFunctions, override
|
||||
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
|
||||
from UM.Settings.ContainerStack import ContainerStack
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
|
@ -86,6 +86,7 @@ class ExtruderStack(CuraContainerStack):
|
|||
def setCompatibleMaterialDiameter(self, value: float) -> None:
|
||||
old_approximate_diameter = self.getApproximateMaterialDiameter()
|
||||
if self.getCompatibleMaterialDiameter() != value:
|
||||
CachedMemberFunctions.clearInstanceCache(self)
|
||||
self.definitionChanges.setProperty("material_diameter", "value", value)
|
||||
self.compatibleMaterialDiameterChanged.emit()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue