This old function is only necessary for upgrading from before v3.4. Best not let it crash in any other case, even if that would sometimes make very old machine instances corrupt if I made a mistake in thinking here.
Fixes Sentry issue CURA-3XG.
Conflicts:
cura/PlatformPhysics.py -> Removed shapely on master, while QTimer import got updated to Qt6.
plugins/Toolbox -> Entire folder is deleted in master, but it was updated to Qt6 here. This can all be removed.
This is currently only used in the pre-read of workspaces. In some cases, the project file may have a material that is not compatible with its own stack using the current rules in Cura, either because the rules changed or because the project file is wrongly crafted/edited. This causes Cura to say there are no quality profiles if the material profile is not compatible with the printer, preventing a crash due to the KeyError.
When removing a printer, the files in %appdata%/cura/<version>/
/definition_changes/ remained intact. This commit fixes that by
making sure that the definitionChanges are removed before removing
the machine.
This was originally added for backwards compatibility with old versions of Uranium. However the link between Cura versions and Uranium versions is already very strong (Cura crashes with old Uranium versions) so this is not necessary.
It was also adding warnings in our log that these extruders had already been added to the printer.
Done during Turbo Testing and Tooling, to clean up our log files.
When switching printers, it would first emit the global container changed signal which connects to _onGlobalContainerChanged, then update stuff in the extruder manager, then manually call _onGlobalContainerChanged again to update some other stuff with the new data from the extruder manager. This was prohibitively expensive, so this prevents that.
Another double or triple emit of the activeExtruderChanged was removed in the extruder manager when creating the extruders for a printer: It would first set the extruder number to 0, possibly emitting the signal, then emit the signal just to be sure since the extruder itself changed (rather than just the number), and then change the extruder number to the preferred extruder, possibly again emitting a signal. Now it just sets the extruder number to the preferred extruder and always emits the signal once (either through setting the extruder number or manually afterwards).
Contributes to issue CURA-6793.
The extruders are added when changing printers anyway, and we call this change signal upon start-up. So one of them is going to do unnecessary work.
Contributes to issue CURA-6793.