Add setting_version every time we create InstanceContainer

Except when we fill the instancecontainer via deserialising. Because then we want to retain the original version number.

Contributes to issue CURA-3427.
This commit is contained in:
Ghostkeeper 2017-05-15 10:39:53 +02:00
parent c61baf3355
commit ccda155882
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
7 changed files with 12 additions and 3 deletions

View file

@ -1,4 +1,4 @@
# Copyright (c) 2016 Ultimaker B.V.
# Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from PyQt5.QtCore import pyqtSignal, pyqtProperty, QObject, QVariant #For communicating data and events to Qt.
@ -362,6 +362,7 @@ class ExtruderManager(QObject):
user_profile = InstanceContainer(extruder_stack_id + "_current_settings") # Add an empty user profile.
user_profile.addMetaDataEntry("type", "user")
user_profile.addMetaDataEntry("extruder", extruder_stack_id)
user_profile.addMetaDataEntry("setting_version", machine_definition.getMetaDataEntry("setting_version", default = 0))
user_profile.setDefinition(machine_definition)
container_registry.addContainer(user_profile)
container_stack.addContainer(user_profile)