* Modify BMessageValueNode to use delayed child creation flag.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42334 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
abacf1bd3b
commit
a2d074a765
@ -93,7 +93,6 @@ BMessageValueNode::BMessageValueNode(ValueNodeChild* nodeChild,
|
|||||||
:
|
:
|
||||||
ValueNode(nodeChild),
|
ValueNode(nodeChild),
|
||||||
fType(type),
|
fType(type),
|
||||||
fValid(false),
|
|
||||||
fMessage()
|
fMessage()
|
||||||
{
|
{
|
||||||
fType->AcquireReference();
|
fType->AcquireReference();
|
||||||
@ -291,9 +290,6 @@ BMessageValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,
|
|||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
fValid = true;
|
|
||||||
CreateChildren();
|
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,11 +297,6 @@ BMessageValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,
|
|||||||
status_t
|
status_t
|
||||||
BMessageValueNode::CreateChildren()
|
BMessageValueNode::CreateChildren()
|
||||||
{
|
{
|
||||||
// delay child creation until our location / value has been resolved
|
|
||||||
// since we otherwise have no idea as to what value nodes to present
|
|
||||||
if (!fValid)
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
|
|
||||||
if (!fChildren.IsEmpty())
|
if (!fChildren.IsEmpty())
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@ public:
|
|||||||
ValueLocation*& _location,
|
ValueLocation*& _location,
|
||||||
Value*& _value);
|
Value*& _value);
|
||||||
|
|
||||||
|
virtual bool ChildCreationNeedsValue() const
|
||||||
|
{ return true; }
|
||||||
virtual status_t CreateChildren();
|
virtual status_t CreateChildren();
|
||||||
virtual int32 CountChildren() const;
|
virtual int32 CountChildren() const;
|
||||||
virtual ValueNodeChild* ChildAt(int32 index) const;
|
virtual ValueNodeChild* ChildAt(int32 index) const;
|
||||||
@ -40,7 +42,6 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Type* fType;
|
Type* fType;
|
||||||
bool fValid;
|
|
||||||
BMessage fMessage;
|
BMessage fMessage;
|
||||||
ChildNodeList fChildren;
|
ChildNodeList fChildren;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user