From abacf1bd3b939c79c31cf8fb619e8f1130fc0ceb Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 28 Jun 2011 00:20:32 +0000 Subject: [PATCH] * 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 --- .../user_interface/gui/team_window/VariablesView.cpp | 12 ++++++++++++ src/apps/debugger/value/ValueNode.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp index ee47f921b6..4ac7c0e863 100644 --- a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp @@ -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; diff --git a/src/apps/debugger/value/ValueNode.h b/src/apps/debugger/value/ValueNode.h index 13c78872f4..449aba779d 100644 --- a/src/apps/debugger/value/ValueNode.h +++ b/src/apps/debugger/value/ValueNode.h @@ -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;