mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-19 12:47:49 -06:00
Compare version-objects, not strings.
This would've gone so wrong if we actually released 4.10 without this, since, as a string, 4.10 is 'smaller than' 4.6 (for example), because alphanumerical-order. done as part of CURA-8269
This commit is contained in:
parent
cb2a7e1daa
commit
4fc43c2b32
1 changed files with 3 additions and 2 deletions
|
@ -14,6 +14,7 @@ from UM.Logger import Logger
|
||||||
from UM.Message import Message
|
from UM.Message import Message
|
||||||
from UM.Platform import Platform
|
from UM.Platform import Platform
|
||||||
from UM.Resources import Resources
|
from UM.Resources import Resources
|
||||||
|
from UM.Version import Version
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
|
@ -134,8 +135,8 @@ class Backup:
|
||||||
"Tried to restore a Cura backup without having proper data or meta data."))
|
"Tried to restore a Cura backup without having proper data or meta data."))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
current_version = self._application.getVersion()
|
current_version = Version(self._application.getVersion())
|
||||||
version_to_restore = self.meta_data.get("cura_release", "master")
|
version_to_restore = Version(self.meta_data.get("cura_release", "master"))
|
||||||
|
|
||||||
if current_version < version_to_restore:
|
if current_version < version_to_restore:
|
||||||
# Cannot restore version newer than current because settings might have changed.
|
# Cannot restore version newer than current because settings might have changed.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue