Don't use deprecated Preferences.getInstance()

Contributes to issue CURA-6600.
This commit is contained in:
Ghostkeeper 2019-08-23 14:46:42 +02:00
parent 3de5aa3307
commit 4fb656ea7b
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -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()