C++ 20
This commit is contained in:
parent
4a248e5622
commit
befe57530a
3 changed files with 20 additions and 42 deletions
|
|
@ -361,23 +361,13 @@ void WarpGraphModel::refreshFromClient() {
|
|||
}
|
||||
|
||||
if (m_ghostNodes.erase(qtId)) {
|
||||
std::vector<QtNodes::ConnectionId> gcToRemove;
|
||||
for (auto gcIt = m_ghostConnections.begin();
|
||||
gcIt != m_ghostConnections.end();) {
|
||||
if (gcIt->outNodeId == qtId || gcIt->inNodeId == qtId) {
|
||||
gcToRemove.push_back(*gcIt);
|
||||
gcIt = m_ghostConnections.erase(gcIt);
|
||||
} else {
|
||||
++gcIt;
|
||||
}
|
||||
}
|
||||
for (const auto &gc : gcToRemove) {
|
||||
auto cIt = m_connections.find(gc);
|
||||
if (cIt != m_connections.end()) {
|
||||
m_connections.erase(cIt);
|
||||
Q_EMIT connectionDeleted(gc);
|
||||
}
|
||||
}
|
||||
std::erase_if(m_ghostConnections, [&](const auto &gc) {
|
||||
if (gc.outNodeId != qtId && gc.inNodeId != qtId)
|
||||
return false;
|
||||
m_connections.erase(gc);
|
||||
Q_EMIT connectionDeleted(gc);
|
||||
return true;
|
||||
});
|
||||
Q_EMIT nodeUpdated(qtId);
|
||||
}
|
||||
continue;
|
||||
|
|
@ -396,25 +386,13 @@ void WarpGraphModel::refreshFromClient() {
|
|||
|
||||
if (ghostMatch != 0) {
|
||||
m_ghostNodes.erase(ghostMatch);
|
||||
{
|
||||
std::vector<QtNodes::ConnectionId> gcToRemove;
|
||||
for (auto gcIt = m_ghostConnections.begin();
|
||||
gcIt != m_ghostConnections.end();) {
|
||||
if (gcIt->outNodeId == ghostMatch || gcIt->inNodeId == ghostMatch) {
|
||||
gcToRemove.push_back(*gcIt);
|
||||
gcIt = m_ghostConnections.erase(gcIt);
|
||||
} else {
|
||||
++gcIt;
|
||||
}
|
||||
}
|
||||
for (const auto &gc : gcToRemove) {
|
||||
auto cIt = m_connections.find(gc);
|
||||
if (cIt != m_connections.end()) {
|
||||
m_connections.erase(cIt);
|
||||
Q_EMIT connectionDeleted(gc);
|
||||
}
|
||||
}
|
||||
}
|
||||
std::erase_if(m_ghostConnections, [&](const auto &gc) {
|
||||
if (gc.outNodeId != ghostMatch && gc.inNodeId != ghostMatch)
|
||||
return false;
|
||||
m_connections.erase(gc);
|
||||
Q_EMIT connectionDeleted(gc);
|
||||
return true;
|
||||
});
|
||||
m_pwToQt.emplace(nodeInfo.id.value, ghostMatch);
|
||||
auto &data = m_nodes[ghostMatch];
|
||||
data.info = nodeInfo;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue