MCPcopy Create free account
hub / github.com/IChooseYou/Reclass / updateCommandRow

Method updateCommandRow

src/controller.cpp:1482–1552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1480}
1481
1482void RcxController::updateCommandRow() {
1483 // -- Source label: driven by provider metadata --
1484 QString src;
1485 QString provName = m_doc->provider->name();
1486 if (provName.isEmpty()) {
1487 src = QStringLiteral("source\u25BE");
1488 } else {
1489 src = QStringLiteral("'%1'\u25BE")
1490 .arg(provName);
1491 }
1492
1493 // -- Symbol for selected node (getSymbol integration) --
1494 QString sym;
1495 if (m_selIds.size() == 1) {
1496 uint64_t sid = *m_selIds.begin();
1497 int idx = m_doc->tree.indexOfId(sid & ~kFooterIdBit);
1498 if (idx >= 0) {
1499 const auto& node = m_doc->tree.nodes[idx];
1500 uint64_t addr = m_doc->tree.baseAddress + m_doc->tree.computeOffset(idx);
1501 sym = m_doc->provider->getSymbol(addr);
1502 }
1503 }
1504
1505 QString addr = QStringLiteral("0x") +
1506 QString::number(m_doc->tree.baseAddress, 16).toUpper();
1507
1508 // Build the row. If we have a symbol, append it after the address.
1509 QString row;
1510 if (sym.isEmpty()) {
1511 row = QStringLiteral("%1 \u00B7 %2")
1512 .arg(elide(src, 40), elide(addr, 24));
1513 } else {
1514 row = QStringLiteral("%1 \u00B7 %2 %3")
1515 .arg(elide(src, 40), elide(addr, 24), elide(sym, 40));
1516 }
1517
1518 // Build row 2: root class type + name (uses current view root)
1519 QString row2;
1520 if (m_viewRootId != 0) {
1521 int vi = m_doc->tree.indexOfId(m_viewRootId);
1522 if (vi >= 0) {
1523 const auto& n = m_doc->tree.nodes[vi];
1524 QString keyword = n.resolvedClassKeyword();
1525 QString className = n.structTypeName.isEmpty() ? n.name : n.structTypeName;
1526 row2 = QStringLiteral("%1\u25BE %2 {")
1527 .arg(keyword, className.isEmpty() ? QStringLiteral("NoName") : className);
1528 }
1529 }
1530 if (row2.isEmpty()) {
1531 // Fallback: find first root struct
1532 for (int i = 0; i < m_doc->tree.nodes.size(); i++) {
1533 const auto& n = m_doc->tree.nodes[i];
1534 if (n.parentId == 0 && n.kind == NodeKind::Struct) {
1535 QString keyword = n.resolvedClassKeyword();
1536 QString className = n.structTypeName.isEmpty() ? n.name : n.structTypeName;
1537 row2 = QStringLiteral("%1\u25BE %2 {")
1538 .arg(keyword, className.isEmpty() ? QStringLiteral("NoName") : className);
1539 break;

Callers

nothing calls this directly

Calls 8

elideFunction · 0.85
indexOfIdMethod · 0.80
computeOffsetMethod · 0.80
resolvedClassKeywordMethod · 0.80
setCommandRowTextMethod · 0.80
nameMethod · 0.45
sizeMethod · 0.45
getSymbolMethod · 0.45

Tested by

no test coverage detected