Clean up context menu building.
Even if the inspect action is unavailable, continue building the rest of the actions, since they can apply regardless of the value location.
This commit is contained in:
@@ -1953,19 +1953,19 @@ VariablesView::_GetContextActionsForNode(ModelNode* node,
|
|||||||
ContextActionList* actions)
|
ContextActionList* actions)
|
||||||
{
|
{
|
||||||
ValueLocation* location = node->NodeChild()->Location();
|
ValueLocation* location = node->NodeChild()->Location();
|
||||||
|
status_t result = B_OK;
|
||||||
// if the location's stored somewhere other than in memory,
|
|
||||||
// then we won't be able to inspect it this way.
|
|
||||||
if (location->PieceAt(0).type != VALUE_PIECE_LOCATION_MEMORY)
|
|
||||||
return B_OK;
|
|
||||||
|
|
||||||
BMessage* message = NULL;
|
BMessage* message = NULL;
|
||||||
status_t result = _AddContextAction("Inspect", MSG_SHOW_INSPECTOR_WINDOW,
|
|
||||||
|
// only show the Inspect option if the value is in fact located
|
||||||
|
// in memory.
|
||||||
|
if (location->PieceAt(0).type == VALUE_PIECE_LOCATION_MEMORY) {
|
||||||
|
result = _AddContextAction("Inspect", MSG_SHOW_INSPECTOR_WINDOW,
|
||||||
actions, message);
|
actions, message);
|
||||||
if (result != B_OK)
|
if (result != B_OK)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
message->AddUInt64("address", location->PieceAt(0).address);
|
message->AddUInt64("address", location->PieceAt(0).address);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
result = _AddContextAction("Cast as" B_UTF8_ELLIPSIS,
|
result = _AddContextAction("Cast as" B_UTF8_ELLIPSIS,
|
||||||
MSG_SHOW_TYPECAST_NODE_PROMPT, actions, message);
|
MSG_SHOW_TYPECAST_NODE_PROMPT, actions, message);
|
||||||
|
|||||||
Reference in New Issue
Block a user