* Extend ValueNode to be able to indicate that a node needs child creation

requests delayed until its location/value have been resolved. Update
  VariablesView to make use of that flag.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42333 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent
2011-06-28 00:20:32 +00:00
parent 02cd58f418
commit abacf1bd3b
2 changed files with 14 additions and 0 deletions
@@ -853,6 +853,13 @@ VariablesView::VariableTableModel::ValueNodeValueChanged(ValueNode* valueNode)
if (modelNode == NULL)
return;
if (valueNode->ChildCreationNeedsValue()
&& !valueNode->ChildrenCreated()) {
status_t error = valueNode->CreateChildren();
if (error != B_OK)
return;
}
// check whether the value actually changed
Value* value = valueNode->GetValue();
if (value == modelNode->GetValue())
@@ -1115,6 +1122,11 @@ VariablesView::VariableTableModel::_AddChildNodes(ValueNodeChild* nodeChild)
valueNode = nodeChild->Node();
}
// check if this node requires child creation
// to be deferred until after its location/value have been resolved
if (valueNode->ChildCreationNeedsValue())
return B_OK;
// create the children, if not done yet
if (valueNode->ChildrenCreated())
return B_OK;
+2
View File
@@ -47,6 +47,8 @@ public:
{ return fContainer; }
void SetContainer(ValueNodeContainer* container);
virtual bool ChildCreationNeedsValue() const
{ return false; }
bool ChildrenCreated() const
{ return fChildrenCreated; }
virtual status_t CreateChildren() = 0;