Remove optimisation that broke updates of models upon metadata change

If the metadata changed, such as whether a material was favourite or not, then the materials models were not updating any more because the actual list of available materials was still the same.
I've removed this optimisation and tested performance locally. It seems to be slightly slower (though that might be placebo or measurement error). However most of the performance boost of cura-6016 was resulting from different changes there so the interface still seems to be quite a lot faster than what it used to be.

Contributes to issue CURA-6032.
This commit is contained in:
Ghostkeeper 2018-12-18 16:52:04 +01:00
parent c0c45519a0
commit 66ed9ed201
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -106,10 +106,7 @@ class BaseMaterialsModel(ListModel):
return False
extruder_stack = global_stack.extruders[extruder_position]
available_materials = self._material_manager.getAvailableMaterialsForMachineExtruder(global_stack, extruder_stack)
if available_materials == self._available_materials:
return False
self._available_materials = available_materials
self._available_materials = self._material_manager.getAvailableMaterialsForMachineExtruder(global_stack, extruder_stack)
if self._available_materials is None:
return False