Author: anevilyak Date: 2011-07-04 14:41:58 +0200 (Mon, 04 Jul 2011) New Revision: 42369 Changeset: https://dev.haiku-os.org/changeset/42369 Modified: haiku/trunk/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp Log: Add a listener hook to notify the parent when model nodes are marked hidden. This allows the variables view to request value/location resolution for those nodes as needed, since it's otherwise unaware of their existence. This is necessary in order to correctly handle nodes which require resolution to happen in order to publish their children, since their value would otherwise never be requested when they're hidden by virtue of being the child of an address node. Modified: haiku/trunk/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp =================================================================== --- haiku/trunk/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp 2011-07-04 03:10:32 UTC (rev 42368) +++ haiku/trunk/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp 2011-07-04 12:41:58 UTC (rev 42369) @@ -46,6 +46,12 @@ VALUE_NODE_TYPE = 'valn' }; + +enum { + MSG_MODEL_NODE_HIDDEN = 'monh' +}; + + // maximum number of array elements to show by default static const uint64 kMaxArrayElementCount = 10; @@ -62,6 +68,8 @@ virtual void ValueNodeChildrenDeleted(ValueNode* node); virtual void ValueNodeValueChanged(ValueNode* node); + virtual void ModelNodeHidden(ModelNode* node); + private: BHandler* fIndirectTarget; VariableTableModel* fModel; @@ -356,6 +364,7 @@ void NodeExpanded(ModelNode* node); void NotifyNodeChanged(ModelNode* node); + void NotifyNodeHidden(ModelNode* node); private: struct NodeHashDefinition { @@ -666,6 +675,20 @@ } +void +VariablesView::ContainerListener::ModelNodeHidden(ModelNode* node) +{ + BReference<ModelNode> nodeReference(node); + + BMessage message(MSG_MODEL_NODE_HIDDEN); + if (message.AddPointer("node", node) == B_OK + && fIndirectTarget->Looper()->PostMessage(&message, fIndirectTarget) + == B_OK) { + nodeReference.Detach(); + } +} + + // #pragma mark - VariableTableModel @@ -1002,6 +1025,13 @@ } +void +VariablesView::VariableTableModel::NotifyNodeHidden(ModelNode* node) +{ + fContainerListener->ModelNodeHidden(node); +} + + status_t VariablesView::VariableTableModel::_AddNode(Variable* variable, ModelNode* parent, ValueNodeChild* nodeChild, bool isPresentationNode, @@ -1047,6 +1077,7 @@ == TYPE_ADDRESS && nodeChildRawType->Kind() == TYPE_COMPOUND) { node->SetHidden(true); + NotifyNodeHidden(node); } } @@ -1372,6 +1403,14 @@ break; } + case MSG_MODEL_NODE_HIDDEN: + { + ModelNode* node; + if (message->FindPointer("node", (void**)&node) == B_OK) + _RequestNodeValue(node); + + break; + } case MSG_VARIABLES_VIEW_CONTEXT_MENU_DONE: { _FinishContextMenu(false);