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

Method updateVariable

src/plugins/debugger/interface/localtreeitem.cpp:51–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51LocalTreeItem *LocalTreeItem::updateVariable(dap::Variable &var)
52{
53 auto it = std::find_if(children.begin(), children.end(), [&](const auto& child) {
54 return child->itemVariable.name == var.name;
55 });
56
57 if (it != children.end()) {
58 auto child = *it;
59 bool updated = child->itemVariable.value != var.value;
60 child->setVariable(var);
61 child->updated = updated;
62
63 if (child->childrenFetched) {
64 child->setChildrenFetched(false);
65 emit updateChildVariables(child->index());
66 }
67
68 emit model->dataChanged(index(), index());
69 return child;
70 }
71
72 return nullptr;
73}
74
75void LocalTreeItem::removeRedundantItems(const QList<LocalTreeItem *> &itemList)
76{

Callers 1

appendItemMethod · 0.80

Calls 5

setChildrenFetchedMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
setVariableMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected