MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / UnlinkAgent

Method UnlinkAgent

AdaptixClient/Source/UI/Graph/SessionsGraph.cpp:168–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void SessionsGraph::UnlinkAgent(const Agent* parentAgent, const Agent* childAgent, bool drawTree) const
169{
170 Q_UNUSED(parentAgent);
171 if (!childAgent || !childAgent->graphItem)
172 return;
173
174 if (childAgent->graphItem->parentItem) {
175 childAgent->graphItem->parentItem->RemoveChild(childAgent->graphItem);
176 childAgent->graphItem->parentItem = nullptr;
177 }
178
179 if (childAgent->graphItem->parentLink) {
180 this->graphScene->removeItem(childAgent->graphItem->parentLink);
181 delete childAgent->graphItem->parentLink;
182 childAgent->graphItem->parentLink = nullptr;
183 }
184
185 this->LinkToRoot(childAgent->graphItem);
186 this->graphScene->addItem( childAgent->graphItem->parentLink );
187
188 childAgent->graphItem->update();
189
190 if (drawTree)
191 this->TreeDraw();
192}
193
194void SessionsGraph::TreeDraw() const
195{

Callers 1

processSyncPacketMethod · 0.80

Calls 6

LinkToRootMethod · 0.95
TreeDrawMethod · 0.95
RemoveChildMethod · 0.45
removeItemMethod · 0.45
addItemMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected