Remove isReadOnly functionality

Everyone should now ask it from the container registry.

Contributes to issue CURA-4243.
This commit is contained in:
Ghostkeeper 2017-11-28 17:30:00 +01:00
parent c63ef6fed6
commit 8707396ad7
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
7 changed files with 35 additions and 48 deletions

View file

@ -180,11 +180,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
material_container_files = [name for name in cura_file_names if name.endswith(self._material_container_suffix)]
for material_container_file in material_container_files:
container_id = self._stripFileToId(material_container_file)
materials = self._container_registry.findInstanceContainers(id=container_id)
material_labels.append(self._getMaterialLabelFromSerialized(archive.open(material_container_file).read().decode("utf-8")))
if materials:
if self._container_registry.findContainersMetadata(id = container_id): #This material already exists.
containers_found_dict["material"] = True
if not materials[0].isReadOnly(): # Only non readonly materials can be in conflict
if not self._container_registry.isReadOnly(container_id): # Only non readonly materials can be in conflict
material_conflict = True
Job.yieldThread()
@ -501,7 +500,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
containers_to_add.append(material_container)
else:
material_container = materials[0]
if not material_container.isReadOnly(): # Only create new materials if they are not read only.
if not self._container_registry.isReadOnly(container_id): # Only create new materials if they are not read only.
if self._resolve_strategies["material"] == "override":
material_container.deserialize(archive.open(material_container_file).read().decode("utf-8"))
elif self._resolve_strategies["material"] == "new":