mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
WIP: Add temporary fix to make materials work with 2.7 version upgrade
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.
This commit is contained in:
parent
5bf080950f
commit
b4949a164c
3 changed files with 10 additions and 0 deletions
|
@ -36,6 +36,10 @@ class XmlMaterialProfile(InstanceContainer):
|
||||||
# \param xml_version: The version number found in an XML file.
|
# \param xml_version: The version number found in an XML file.
|
||||||
# \return The corresponding setting_version.
|
# \return The corresponding setting_version.
|
||||||
def xmlVersionToSettingVersion(self, xml_version: str) -> int:
|
def xmlVersionToSettingVersion(self, xml_version: str) -> int:
|
||||||
|
if xml_version == "1.3":
|
||||||
|
return 2 # FIXME & HACK: This is temporary hack. The setting_version has been increased in CuraApplication,
|
||||||
|
# but we haven't decided on how to determine the versions of an XMLMaterialProfile yet.
|
||||||
|
# This MUST be fixed after the decision has been made.
|
||||||
if xml_version == "1.3":
|
if xml_version == "1.3":
|
||||||
return 1
|
return 1
|
||||||
return 0 #Older than 1.3.
|
return 0 #Older than 1.3.
|
||||||
|
|
|
@ -20,6 +20,10 @@ class XmlMaterialUpgrader(VersionUpgrade):
|
||||||
return version * 1000000 + setting_version
|
return version * 1000000 + setting_version
|
||||||
|
|
||||||
def _xmlVersionToSettingVersion(self, xml_version: str) -> int:
|
def _xmlVersionToSettingVersion(self, xml_version: str) -> int:
|
||||||
|
if xml_version == "1.3":
|
||||||
|
return 2 # FIXME & HACK: This is temporary hack. The setting_version has been increased in CuraApplication,
|
||||||
|
# but we haven't decided on how to determine the versions of an XMLMaterialProfile yet.
|
||||||
|
# This MUST be fixed after the decision has been made.
|
||||||
if xml_version == "1.3":
|
if xml_version == "1.3":
|
||||||
return 1
|
return 1
|
||||||
return 0 #Older than 1.3.
|
return 0 #Older than 1.3.
|
||||||
|
|
|
@ -20,6 +20,8 @@ def getMetaData():
|
||||||
},
|
},
|
||||||
"version_upgrade": {
|
"version_upgrade": {
|
||||||
("materials", 1000000): ("materials", 1000001, upgrader.upgradeMaterial),
|
("materials", 1000000): ("materials", 1000001, upgrader.upgradeMaterial),
|
||||||
|
# FIXME: This needs to be changed once we have decided on how to determine the versions
|
||||||
|
("materials", 1000001): ("materials", 1000002, upgrader.upgradeMaterial),
|
||||||
},
|
},
|
||||||
"sources": {
|
"sources": {
|
||||||
"materials": {
|
"materials": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue