Skip to content

Commit

Permalink
Fix for the bad node count in a callback
Browse files Browse the repository at this point in the history
Fix for bug LP #1078368. Node has to be removed from the internal
structure before calling callbacks.

However, parents of the node have to be notified and therefore the node
information is stored locally to access that information.
  • Loading branch information
izidormatusov committed Jan 22, 2013
1 parent 6e4bddb commit 2bb6d91
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions liblarch/filteredtree.py
Expand Up @@ -235,16 +235,15 @@ def __update_node(self, node_id, direction):
self.nodes[child_id]['parents'].remove(node_id)
self.__update_node(child_id,direction="down")

node = self.nodes.pop(node_id)
for path in paths:
self.callback(action, node_id, path)

# Remove node from cache
for parent_id in self.nodes[node_id]['parents']:
for parent_id in node['parents']:
self.nodes[parent_id]['children'].remove(node_id)
self.__update_node(parent_id,direction="up")

self.nodes.pop(node_id)

# We update parents who are not displayed
# If the node is only hidden and still exists in the tree
if self.tree.has_node(node_id):
Expand Down

0 comments on commit 2bb6d91

Please sign in to comment.