mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 19:05:51 +08:00
Fix issue with deprecation and pyqtSlot
This commit is contained in:
parent
8311a39f08
commit
a3dad0fa09
@ -986,10 +986,13 @@ class MachineManager(QObject):
|
|||||||
self._application.globalContainerStackChanged.emit()
|
self._application.globalContainerStackChanged.emit()
|
||||||
self.forceUpdateAllSettings()
|
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)
|
@pyqtSlot(int, result = QObject)
|
||||||
def getExtruder(self, position: int) -> Optional[ExtruderStack]:
|
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:
|
if self._global_container_stack:
|
||||||
return self._global_container_stack.extruders.get(str(position))
|
return self._global_container_stack.extruders.get(str(position))
|
||||||
return None
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user