Fix issue with deprecation and pyqtSlot

This commit is contained in:
Jaime van Kessel 2019-07-26 10:55:55 +02:00
parent 8311a39f08
commit a3dad0fa09

View file

@ -986,10 +986,13 @@ class MachineManager(QObject):
self._application.globalContainerStackChanged.emit()
self.forceUpdateAllSettings()
# Note that this function is deprecated, but the decorators for this don't play well together!
# @deprecated("use Cura.MachineManager.activeMachine.extruders instead", "4.2")
@pyqtSlot(int, result = QObject)
def getExtruder(self, position: int) -> Optional[ExtruderStack]:
return self._getExtruder(position)
# This is a workaround for the deprecated decorator and the pyqtSlot not playing well together.
@deprecated("use Cura.MachineManager.activeMachine.extruders instead", "4.2")
def _getExtruder(self, position) -> Optional[ExtruderStack]:
if self._global_container_stack:
return self._global_container_stack.extruders.get(str(position))
return None