| 55 | } |
| 56 | |
| 57 | void APIInspector::RevealParameter(SDObject *param) |
| 58 | { |
| 59 | if(!param) |
| 60 | return; |
| 61 | |
| 62 | rdcarray<SDObject *> hierarchy; |
| 63 | while(param) |
| 64 | { |
| 65 | hierarchy.push_back(param); |
| 66 | param = param->GetParent(); |
| 67 | } |
| 68 | |
| 69 | if(hierarchy.back()->type.basetype == SDBasic::Chunk) |
| 70 | { |
| 71 | SDChunk *chunk = (SDChunk *)hierarchy.back(); |
| 72 | hierarchy.pop_back(); |
| 73 | |
| 74 | int rootIdx = m_Chunks.indexOf(chunk); |
| 75 | |
| 76 | SDObject *current = chunk; |
| 77 | |
| 78 | if(rootIdx >= 0) |
| 79 | { |
| 80 | RDTreeWidgetItem *parent = ui->apiEvents->topLevelItem(rootIdx); |
| 81 | |
| 82 | while(parent) |
| 83 | { |
| 84 | ui->apiEvents->expandItem(parent); |
| 85 | |
| 86 | SDObject *next = hierarchy.back(); |
| 87 | hierarchy.pop_back(); |
| 88 | |
| 89 | RDTreeWidgetItem *item = NULL; |
| 90 | |
| 91 | for(size_t i = 0; i < current->NumChildren(); i++) |
| 92 | { |
| 93 | if(current->GetChild(i) == next) |
| 94 | { |
| 95 | current = next; |
| 96 | |
| 97 | int idx = (int)i; |
| 98 | |
| 99 | // revealing a parameter that wasn't added, bail out now |
| 100 | if(idx >= parent->childCount() || parent->child(idx)->tag().value<void *>() != next) |
| 101 | return; |
| 102 | |
| 103 | item = parent->child(idx); |
| 104 | break; |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | parent = item; |
| 109 | |
| 110 | if(hierarchy.empty()) |
| 111 | break; |
| 112 | } |
| 113 | |
| 114 | ui->apiEvents->setSelectedItem(parent); |
nothing calls this directly
no test coverage detected