Fixed duplication if no name was changed

CURA-1427
This commit is contained in:
Jaime van Kessel 2016-06-10 11:48:33 +02:00
parent 1aa11593fa
commit e2e9e7964c

View file

@ -304,6 +304,10 @@ class MachineManagerModel(QObject):
new_name = self._createUniqueName("quality", containers[0].getName(), new_name,
catalog.i18nc("@label", "Custom profile"))
if containers[0].getName() == new_name:
# Nothing to do.
return
# As we also want the id of the container to be changed (so that profile name is the name of the file
# on disk. We need to create a new instance and remove it (so the old file of the container is removed)
# If we don't do that, we might get duplicates & other weird issues.