From c21475abd78a103bfc394e098cd92194a461dd8a Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Sun, 5 Jun 2016 14:05:56 +0200 Subject: [PATCH] Prevent multiple machines having the same custom name Caused by container vs containerstack confusion Fixes CURA-1606 and CURA-1649 --- cura/MachineManagerModel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/MachineManagerModel.py b/cura/MachineManagerModel.py index a0af119636..75b273e1f5 100644 --- a/cura/MachineManagerModel.py +++ b/cura/MachineManagerModel.py @@ -179,8 +179,8 @@ class MachineManagerModel(QObject): i = 1 # Check both the id and the name, because they may not be the same and it is better if they are both unique - while UM.Settings.ContainerRegistry.getInstance().findContainers(None, id = unique_name) or \ - UM.Settings.ContainerRegistry.getInstance().findContainers(None, name = unique_name): + while UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = unique_name, type = "machine") or \ + UM.Settings.ContainerRegistry.getInstance().findContainerStacks(name = unique_name, type = "machine"): i += 1 unique_name = "%s #%d" % (name, i)