Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cura/UI
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2020-06-23 11:14:44 +0300
committerJaime van Kessel <nallath@gmail.com>2020-06-23 11:14:44 +0300
commit46076bf21dbdc873630286e90c4320d3160a3178 (patch)
tree40ed4dd4b936d767b32d1940d36c1067f494f8ca /cura/UI
parentba34fb6e35bc6b128a6c705a9adf62b52a7fbf09 (diff)
Simplify the renameNodes method
Especially when duplicating large amounts of items this would cause a bit of a slowdown CURA-7106
Diffstat (limited to 'cura/UI')
-rw-r--r--cura/UI/ObjectsModel.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/cura/UI/ObjectsModel.py b/cura/UI/ObjectsModel.py
index 1383476665..6abb99932d 100644
--- a/cura/UI/ObjectsModel.py
+++ b/cura/UI/ObjectsModel.py
@@ -98,7 +98,8 @@ class ObjectsModel(ListModel):
return True
- def _renameNodes(self, node_info_dict: Dict[str, _NodeInfo]) -> List[SceneNode]:
+ @staticmethod
+ def _renameNodes(node_info_dict: Dict[str, _NodeInfo]) -> List[SceneNode]:
# Go through all names and find out the names for all nodes that need to be renamed.
all_nodes = [] # type: List[SceneNode]
for name, node_info in node_info_dict.items():
@@ -118,9 +119,7 @@ class ObjectsModel(ListModel):
else:
new_group_name = "{0}#{1}".format(name, current_index)
- old_name = node.getName()
node.setName(new_group_name)
- Logger.log("d", "Node [%s] renamed to [%s]", old_name, new_group_name)
all_nodes.append(node)
return all_nodes