| 244 | } |
| 245 | |
| 246 | void APIInspector::addEvent(const APIEvent &ev, bool primary) |
| 247 | { |
| 248 | if(ev.chunkIndex == APIEvent::NoChunk) |
| 249 | return; |
| 250 | |
| 251 | const SDFile &file = m_Ctx.GetStructuredFile(); |
| 252 | |
| 253 | RDTreeWidgetItem *root = new RDTreeWidgetItem({QString::number(ev.eventId), QString()}); |
| 254 | |
| 255 | SDChunk *chunk = NULL; |
| 256 | |
| 257 | if(ev.chunkIndex < file.chunks.size()) |
| 258 | { |
| 259 | chunk = file.chunks[ev.chunkIndex]; |
| 260 | |
| 261 | m_Chunks.push_back(chunk); |
| 262 | |
| 263 | root->setText(1, SDObject2Variant(chunk, true)); |
| 264 | |
| 265 | addStructuredChildren(root, *chunk); |
| 266 | } |
| 267 | else |
| 268 | { |
| 269 | root->setText(1, tr("Invalid chunk index %1").arg(ev.chunkIndex)); |
| 270 | } |
| 271 | |
| 272 | if(primary) |
| 273 | root->setBold(true); |
| 274 | |
| 275 | root->setTag(QVariant::fromValue((quintptr)(void *)chunk)); |
| 276 | |
| 277 | ui->apiEvents->addTopLevelItem(root); |
| 278 | |
| 279 | ui->apiEvents->setSelectedItem(root); |
| 280 | } |
nothing calls this directly
no test coverage detected