* 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:
@@ -853,6 +853,13 @@ VariablesView::VariableTableModel::ValueNodeValueChanged(ValueNode* valueNode)
|
|||||||
if (modelNode == NULL)
|
if (modelNode == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (valueNode->ChildCreationNeedsValue()
|
||||||
|
&& !valueNode->ChildrenCreated()) {
|
||||||
|
status_t error = valueNode->CreateChildren();
|
||||||
|
if (error != B_OK)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// check whether the value actually changed
|
// check whether the value actually changed
|
||||||
Value* value = valueNode->GetValue();
|
Value* value = valueNode->GetValue();
|
||||||
if (value == modelNode->GetValue())
|
if (value == modelNode->GetValue())
|
||||||
@@ -1115,6 +1122,11 @@ VariablesView::VariableTableModel::_AddChildNodes(ValueNodeChild* nodeChild)
|
|||||||
valueNode = nodeChild->Node();
|
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
|
// create the children, if not done yet
|
||||||
if (valueNode->ChildrenCreated())
|
if (valueNode->ChildrenCreated())
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ public:
|
|||||||
{ return fContainer; }
|
{ return fContainer; }
|
||||||
void SetContainer(ValueNodeContainer* container);
|
void SetContainer(ValueNodeContainer* container);
|
||||||
|
|
||||||
|
virtual bool ChildCreationNeedsValue() const
|
||||||
|
{ return false; }
|
||||||
bool ChildrenCreated() const
|
bool ChildrenCreated() const
|
||||||
{ return fChildrenCreated; }
|
{ return fChildrenCreated; }
|
||||||
virtual status_t CreateChildren() = 0;
|
virtual status_t CreateChildren() = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user