Skip to content

Commit

Permalink
schemeedit: Use all_nodes/links/annotations where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed Jul 27, 2021
1 parent 717b0a7 commit 6f658e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions orangecanvas/document/schemeedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ def enumerateTitle(self, title):
"""
if self.__scheme is None:
return title
curr_titles = set([node.title for node in self.__scheme.nodes])
curr_titles = set([node.title for node in self.__scheme.all_nodes()])
template = title + " ({0})"

enumerated = (template.format(i) for i in itertools.count(1))
Expand All @@ -1096,8 +1096,8 @@ def nextPosition(self):
Return the next default node position as a (x, y) tuple. This is
a position left of the last added node.
"""
if self.__scheme is not None:
nodes = self.__scheme.nodes
if self.__root is not None:
nodes = self.__root.nodes()
else:
nodes = []
if nodes:
Expand Down Expand Up @@ -2371,7 +2371,7 @@ def __paste(self, nodedups, linkdups, pos: Optional[QPointF] = None,
return

# find unique names for new nodes
allnames = {node.title for node in scheme.nodes + nodedups}
allnames = {node.title for node in scheme.all_nodes() + nodedups}
for nodedup in nodedups:
nodedup.title = uniquify(
nodedup.title, allnames, pattern="{item} ({_})", start=1)
Expand Down

0 comments on commit 6f658e1

Please sign in to comment.