The material is no longer listed in the profiles and no longer filtered for, so we don't need to create a new profile for each material.
Contributes to issues CURA-844 and CURA-2320.
It is checked if the file data is None or empty (the upgrade is then considered 'failed'). But to unpack the file data, it needs to be a tuple.
Contributes to issue CURA-844.
The current settings in 2.1 specified a machine instance. In 2.2 they specify a machine definition. There is not enough information in one file to be able to translate that.
Contributes to issue CURA-844.
Falling back to normal.inst.cfg isn't enough. That profile may be filtered out by the machine, variant and material. We need to fall back to a different quality profile depending on the machine, variant and material.
Contributes to issue CURA-844.
Custom profiles are always quality changes. They should always say quality in the original anyway; that was an assumption we've made thousands of times.
Contributes to issue CURA-844.
We don't know the actual quality type, the quality profile that this profile is based on. Maybe there isn't one, even. As a solution we always base imported custom quality profiles on normal.
Contributes to issue CURA-844.
These profiles were not thought of as built-in. Instead, they were sorta constructed from pieces. That complex piece of code won't be necessary any more after I add this and after Cura 2.3 has proper profile inheritance again.
Contributes to issue CURA-844.
The quality profile now sometimes gets updated to a quality profile, and sometimes to a quality-changes profile, depending on whether the profile is built-in or not.
Contributes to issue CURA-2006.
This prevents a mix-up of how material names should be translated for quality profiles and how material names should be translated for material profiles.
Contributes to issue CURA-844.
One was in metadata. That is the correct one. The other is unnecessary and was being ignored, but we don't need to write it.
Contributes to issue CURA-844.
Currently it sets the user profile to 'empty', which is bad because empty is read-only. But it allows me to continue for now. I'll find a solution for that later.
Contributes to issue CURA-844.
Turns out that copy.copy() doesn't work on ConfigParsers. It returns a different instance but modifying that instance still modifies the old configs. Deep copy isn't allowed. But this dictionary copy works.
Contributes to issue CURA-844.
If the old profile didn't specify any material, it would be global. But if the new machine specifies that its profiles are material-specific, these profiles have to be split into multiple profiles in order to be able to show them in Cura 2.2.
Contributes to issue CURA-844.