Fix a case where values wouldn't be requested properly.

- If a node was already expanded, and we then removed/replaced
  its children, those wouldn't automatically get their value nodes
  added. Consequently, value retrieval for them would fail until
  the parent was collapsed/re-expanded. If we encounter such a
  model node when receiving a value request, notify the table model so
  it can construct the value node appropriately.
This commit is contained in:
Rene Gollent
2013-04-27 16:04:33 -04:00
parent 7198436cc2
commit 6a2d6f5062
@@ -998,11 +998,9 @@ VariablesView::VariableTableModel::ValueNodeChildrenCreated(
child->IsInternal(), childCount == 1); child->IsInternal(), childCount == 1);
} }
if (valueNode->ChildCreationNeedsValue()) { ModelNode* childNode = fNodeTable.Lookup(child);
ModelNode* childNode = fNodeTable.Lookup(child); if (childNode != NULL)
if (childNode != NULL) fContainerListener->ModelNodeValueRequested(childNode);
fContainerListener->ModelNodeValueRequested(childNode);
}
} }
if (valueNode->ChildCreationNeedsValue()) if (valueNode->ChildCreationNeedsValue())
@@ -1921,9 +1919,23 @@ VariablesView::_RequestNodeValue(ModelNode* node)
// get the value node and check whether its value has not yet been resolved // get the value node and check whether its value has not yet been resolved
ValueNode* valueNode = nodeChild->Node(); ValueNode* valueNode = nodeChild->Node();
if (valueNode == NULL if (valueNode == NULL) {
|| valueNode->LocationAndValueResolutionState() ModelNode* parent = node->Parent();
!= VALUE_NODE_UNRESOLVED) { if (parent != NULL) {
TreeTablePath path;
if (!fVariableTableModel->GetTreePath(parent, path))
return;
// if the parent node was already expanded when the child was
// added, we may not yet have added a value node.
// Notify the table model that this needs to be done.
if (fVariableTable->IsNodeExpanded(path))
fVariableTableModel->NodeExpanded(parent);
}
}
if (valueNode == NULL || valueNode->LocationAndValueResolutionState()
!= VALUE_NODE_UNRESOLVED) {
return; return;
} }