MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / updateThreadList

Method updateThreadList

src/plugins/debugger/dap/dapdebugger.cpp:1039–1056  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1037}
1038
1039void DAPDebugger::updateThreadList(int curr, const dap::array<dap::Thread> &threads)
1040{
1041 d->threadSelector->clear();
1042 int currIdx = -1;
1043 for (const auto &e : threads) {
1044 QString itemText = "#" + QString::number(e.id) + " " + e.name.c_str();
1045 d->threadSelector->addItem(itemText);
1046 if (curr == e.id)
1047 currIdx = d->threadSelector->count() - 1;
1048 }
1049 if (currIdx != -1)
1050 d->threadSelector->setCurrentIndex(currIdx);
1051 else if (!threads.empty()) {
1052 d->threadSelector->setCurrentIndex(0);
1053 int threadId = static_cast<int>(threads.at(0).id);
1054 switchCurrentThread(threadId);
1055 }
1056}
1057
1058void DAPDebugger::switchCurrentThread(int threadId)
1059{

Callers

nothing calls this directly

Calls 8

numberClass · 0.85
c_strMethod · 0.80
atMethod · 0.80
clearMethod · 0.45
addItemMethod · 0.45
countMethod · 0.45
setCurrentIndexMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected