CURA-4270
Technically, this is not right. This is just to postpone a time bomb...
The XML material profile needs a setting number instead of getting it
derived from the schema version.
Otherwise we fall back to the manufacturer in the machine definition. If that fails too, we fall back to Unknown (rather than an empty string).
Contributes to issue CURA-4157.
CURA-3975
This is a temporary fix to make materials work with 2.7 version upgrade
because of the setting_version change from 1 to 2. This MUST be fixed
after we have decided on how to determine the versions of an
XMLMaterialProfile.
Because of this wrong MIME type, the material profile would get saved using the preferred extension of the instance container, .inst.cfg. This would then get interpreted as having the MIME type of instance containers, and then it would fail to load because it is not an INI file.
Now it stores it as .xml.fdm_material and so the MIME type database interprets it as an XML file.
Contributes to issue CURA-3937.
NB: previously the "approximate_diameter" metadata was stored as a number. This caused some issues passing arguments from QML to Python. Now "approximate_diameter" is stored as a string.
1.2 and lower didn't specify a version number. Assume that it was 1.2. We feed this through our translation function for form, mostly, because we know that the setting_version should be 0 then.
Contributes to issue CURA-3427.
The density is already put in the 'properties' metadata entry. Don't need to put it in there doubly. Turns out that this density line was originally just superfluous.
Contributes to issue CURA-3427 or something.
The setting_version is translated from the version number. The setting_version number currently happens to be the same as the version number of XML but that won't always be the case so we introduce a translation-step as well.
Contributes to issue CURA-3427.
That density variable was never used. Hope this fixes some unaccounted-for bug.
Doesn't contribute to CURA-3427 but I'm listing it as if it does anyway.
The setName function is intended if the user changes the name (as by means of the edit material menu).
For deserializing this simply gives too much overhead