mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-18 20:28:01 -06:00
Update _favorite_ids in BaseMaterialsModel._update
And make all subclasses run its super _update as well to make sure that this gets updated for them. It's necessary for the _createMaterialItem functionality because it needs to add an is_favorite role. Contributes to issue CURA-6600.
This commit is contained in:
parent
5d76f96354
commit
ea1c99b708
4 changed files with 7 additions and 10 deletions
|
@ -4,6 +4,8 @@
|
|||
from typing import Optional, Dict, Set
|
||||
|
||||
from PyQt5.QtCore import Qt, pyqtSignal, pyqtProperty
|
||||
|
||||
from UM.Preferences import Preferences
|
||||
from UM.Qt.ListModel import ListModel
|
||||
|
||||
import cura.CuraApplication # Imported like this to prevent a circular reference.
|
||||
|
@ -111,7 +113,7 @@ class BaseMaterialsModel(ListModel):
|
|||
## This is an abstract method that needs to be implemented by the specific
|
||||
# models themselves.
|
||||
def _update(self):
|
||||
pass
|
||||
self._favorite_ids = set(Preferences.getInstance().getValue("cura/favorite_materials").split(";"))
|
||||
|
||||
## This method is used by all material models in the beginning of the
|
||||
# _update() method in order to prevent errors. It's the same in all models
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue