Browse Source

Read SDK version from new semver field

The sdk_version field should stay the ordinary plain number (the major version number of the semver field) so that older Cura versions don't break. Newly built packages will get built with both sdk_version_semver and the normal sdk_version, so that the packages can be read with any Cura version from 3.6 onwards.

Contributes to issue CURA-5940.
Ghostkeeper 6 years ago
parent
commit
78e6494430
1 changed files with 2 additions and 1 deletions
  1. 2 1
      plugins/Toolbox/src/Toolbox.py

+ 2 - 1
plugins/Toolbox/src/Toolbox.py

@@ -511,7 +511,8 @@ class Toolbox(QObject, Extension):
         # version, we also need to check if the current one has a lower SDK version. If so, this package should also
         # be upgradable.
         elif remote_version == local_version:
-            can_upgrade = local_package.get("sdk_version", 0) < remote_package.get("sdk_version", 0)
+            # First read sdk_version_semver. If that doesn't exist, read just sdk_version (old version system).
+            can_upgrade = local_package.get("sdk_version_semver", local_package.get("sdk_version", 0)) < remote_package.get("sdk_version_semver", remote_package.get("sdk_version", 0))
 
         return can_upgrade