work towards making timeline actions all undoable

This commit is contained in:
itsmattkc
2019-09-23 23:00:15 +10:00
parent d0d4756129
commit 9fa22938b9
31 changed files with 994 additions and 378 deletions
+11
View File
@@ -78,6 +78,13 @@ const QVector<NodeEdgePtr> &NodeParam::edges()
return edges_;
}
void NodeParam::DisconnectAll()
{
while (!edges_.isEmpty()) {
DisconnectEdge(edges_.first());
}
}
bool NodeParam::AreDataTypesCompatible(NodeParam *a, NodeParam *b)
{
// Make sure one is an input and one is an output
@@ -159,6 +166,10 @@ NodeEdgePtr NodeParam::ConnectEdge(NodeOutput *output, NodeInput *input)
NodeEdgePtr edge = std::make_shared<NodeEdge>(output, input);
// The nodes should never be the same, and since we lock both nodes here, this can lead to a entire program freeze
// that's difficult to diagnose. This makes that issue very clear.
Q_ASSERT(output->parent() != input->parent());
output->parent()->Lock();
input->parent()->Lock();