mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 02:09:02 +08:00
Package upgrade should also check SDK version
This commit is contained in:
parent
7a3e61e8f1
commit
b39d6c7d87
@ -488,7 +488,17 @@ class Toolbox(QObject, Extension):
|
|||||||
|
|
||||||
local_version = Version(local_package["package_version"])
|
local_version = Version(local_package["package_version"])
|
||||||
remote_version = Version(remote_package["package_version"])
|
remote_version = Version(remote_package["package_version"])
|
||||||
return remote_version > local_version
|
|
||||||
|
can_upgrade = False
|
||||||
|
if remote_version > local_version:
|
||||||
|
can_upgrade = True
|
||||||
|
# A package with the same version can be built to have different SDK versions. So, for a package with the same
|
||||||
|
# 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 and local_package.get("sdk_version", 0) < int(self._getSDKVersion()):
|
||||||
|
can_upgrade = True
|
||||||
|
|
||||||
|
return can_upgrade
|
||||||
|
|
||||||
@pyqtSlot(str, result = bool)
|
@pyqtSlot(str, result = bool)
|
||||||
def canDowngrade(self, package_id: str) -> bool:
|
def canDowngrade(self, package_id: str) -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user