From 4fb656ea7bcd008ebf5f320167d8cb91403e8db4 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 23 Aug 2019 14:46:42 +0200 Subject: [PATCH] Don't use deprecated Preferences.getInstance() Contributes to issue CURA-6600. --- cura/Machines/Models/BaseMaterialsModel.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cura/Machines/Models/BaseMaterialsModel.py b/cura/Machines/Models/BaseMaterialsModel.py index c669e84f5e..ec4c2dd4f6 100644 --- a/cura/Machines/Models/BaseMaterialsModel.py +++ b/cura/Machines/Models/BaseMaterialsModel.py @@ -5,7 +5,6 @@ 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. @@ -113,7 +112,7 @@ class BaseMaterialsModel(ListModel): ## This is an abstract method that needs to be implemented by the specific # models themselves. 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. global_stack = cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack()