Skip to content

Commit

Permalink
Use tree instead of stack for the names of the uninit actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Flova committed Apr 5, 2024
1 parent 8464396 commit 3ea11a7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ def to_q_item_model(self):
# Start with the root/bottom of the stack
stack_element = self.stack

# Store the corresponding tree element
tree_element = self.tree

# Go through all stack elements
while stack_element is not None:
# Sanity check
Expand All @@ -327,7 +330,7 @@ def to_q_item_model(self):
# Set the text of the item
if stack_element["type"] == "sequence":
# Get the names of all actions
action_names = [element["name"] for element in stack_element["current_action"]]
action_names = [action["name"] for action in tree_element["action_elements"]]
# Join them together and set the text
elem_item.setText("Sequence: " + ", ".join(action_names))
else:
Expand All @@ -351,6 +354,9 @@ def to_q_item_model(self):

# Go to next element
stack_element = stack_element["next"]
# Also select the corresponding tree element if there are any
if "children" in tree_element and stack_element is not None:
tree_element = tree_element["children"][stack_element["activation_reason"]]

return model

Expand Down

0 comments on commit 3ea11a7

Please sign in to comment.