mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 22:08:59 +08:00
Simplify the renameNodes method
Especially when duplicating large amounts of items this would cause a bit of a slowdown CURA-7106
This commit is contained in:
parent
ba34fb6e35
commit
46076bf21d
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user