These places weren't interested in all changes. They can probably be more
strict, but the camera is a really safe bet (and already greatly decreases
the number of updates, especially when just moving the camera)
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.
CURA-6015
ListModels should not modify items directly. All ListModels should use
setItems() and the insertions/removals/modifications will be done in
setItems() itself.
Since there was so much debate regarding the unit testing of the visiblity presets, i had another look at it.
The old version was almost untestable because all functionalities were mushed together into a single class.
CURA-5734
Contributes to CURA-5682
- Active material is now expanded by default when opening the manager
- Expanded and collapsed sections are saved to preferences
- Sections are now highlighted when collapsed and having a selected material inside
- Bug with losing focus between fields is not yet fixed
Note that this is still not correct. When the value gets evaluated, we
need to evaluate it with that container in the stack(s), but this case,
the stack may have other containers, so the evaluation can give
incorrect values because its context is simply not correct. This change
only prevents it from breaking because it's missing a provider.
Did this so that models can be updated more often fixing bugs where when a material is set as "not favorite" in the favorites section, its updated accordingly in its "normal" section.
It's also the ground work for saving material section expansion to preferences.
Contributes to CURA-5378
I was hoping to completely nix the generic materials model (since it's basically just a brand "Generic", but then in the QML it has to be have the same in terms of sub-menus or fold-outs and that looked stupid (Generic -> ABS -> ABS)). So we keep that one for now. It is cleaner though.
Contributes to CURA-5162, CURA-5378