Use timer instead of calling _update directly.

Speeds up when the signal is called very often in a small period.

Contributes to issue CURA-4243.
This commit is contained in:
Jack Ha 2017-12-04 16:29:21 +01:00
parent ac97d0d83f
commit c52451217b

View file

@ -19,7 +19,7 @@ class MaterialsModel(InstanceContainersModel):
# \param container The container whose metadata was changed.
def _onContainerMetaDataChanged(self, container):
if container.getMetaDataEntry("type") == "material": #Only need to update if a material was changed.
self._update()
self._container_change_timer.start()
def _onContainerChanged(self, container):
if container.getMetaDataEntry("type", "") == "material":