mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 04:54:04 -06:00
Add documentation and further specify except around disconnecting signals
Catch just a TypeError instead of all exceptions. Added documentation to say why we catch a TypeError there. Also splitted up the try-except block for the 3 disconnects, just so that if the first fails we still try to disconnect from the other two. Contributes to issue CURA-3497.
This commit is contained in:
parent
d95488a940
commit
86f1a0559f
2 changed files with 8 additions and 2 deletions
|
@ -236,9 +236,15 @@ class MachineManager(QObject):
|
|||
if self._global_container_stack:
|
||||
try:
|
||||
self._global_container_stack.nameChanged.disconnect(self._onMachineNameChanged)
|
||||
except TypeError: #pyQtSignal gives a TypeError when disconnecting from something that was already disconnected.
|
||||
pass
|
||||
try:
|
||||
self._global_container_stack.containersChanged.disconnect(self._onInstanceContainersChanged)
|
||||
except TypeError:
|
||||
pass
|
||||
try:
|
||||
self._global_container_stack.propertyChanged.disconnect(self._onPropertyChanged)
|
||||
except:
|
||||
except TypeError:
|
||||
pass
|
||||
material = self._global_container_stack.material
|
||||
material.nameChanged.disconnect(self._onMaterialNameChanged)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue