mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-17 11:47:50 -06:00
Don't use deprecated Preferences.getInstance()
Contributes to issue CURA-6600.
This commit is contained in:
parent
3de5aa3307
commit
4fb656ea7b
1 changed files with 1 additions and 2 deletions
|
@ -5,7 +5,6 @@ from typing import Optional, Dict, Set
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt, pyqtSignal, pyqtProperty
|
from PyQt5.QtCore import Qt, pyqtSignal, pyqtProperty
|
||||||
|
|
||||||
from UM.Preferences import Preferences
|
|
||||||
from UM.Qt.ListModel import ListModel
|
from UM.Qt.ListModel import ListModel
|
||||||
|
|
||||||
import cura.CuraApplication # Imported like this to prevent a circular reference.
|
import cura.CuraApplication # Imported like this to prevent a circular reference.
|
||||||
|
@ -113,7 +112,7 @@ class BaseMaterialsModel(ListModel):
|
||||||
## This is an abstract method that needs to be implemented by the specific
|
## This is an abstract method that needs to be implemented by the specific
|
||||||
# models themselves.
|
# models themselves.
|
||||||
def _update(self):
|
def _update(self):
|
||||||
self._favorite_ids = set(Preferences.getInstance().getValue("cura/favorite_materials").split(";"))
|
self._favorite_ids = set(cura.CuraApplication.CuraApplication.getInstance().getPreferences().getValue("cura/favorite_materials").split(";"))
|
||||||
|
|
||||||
# Update the available materials (ContainerNode) for the current active machine and extruder setup.
|
# Update the available materials (ContainerNode) for the current active machine and extruder setup.
|
||||||
global_stack = cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack()
|
global_stack = cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue