| 166 | } |
| 167 | |
| 168 | void 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 | |
| 194 | void SessionsGraph::TreeDraw() const |
| 195 | { |
no test coverage detected