moved timeline undoable commands to using the new NodeAddCommand
Previous iteration used some "magic code" that added clips automatically to the timeline. This was functional but ultimately outside of the undo commands' control meaning nodes could be infinitely added and abandoned. This makes the add process part of the undo command which means it's all undoable as the user would expect.
This commit is contained in:
@@ -49,18 +49,6 @@ void NodeGraph::AddNode(Node *node)
|
||||
emit NodeAdded(node);
|
||||
}
|
||||
|
||||
void NodeGraph::AddNodeWithDependencies(Node *node)
|
||||
{
|
||||
// Add node and its connected nodes to graph
|
||||
AddNode(node);
|
||||
|
||||
// Add all of Block's dependencies
|
||||
QList<Node*> node_dependencies = node->GetDependencies();
|
||||
foreach (Node* dep, node_dependencies) {
|
||||
AddNode(dep);
|
||||
}
|
||||
}
|
||||
|
||||
void NodeGraph::TakeNode(Node *node, QObject* new_parent)
|
||||
{
|
||||
if (!ContainsNode(node)) {
|
||||
@@ -84,21 +72,6 @@ void NodeGraph::TakeNode(Node *node, QObject* new_parent)
|
||||
emit NodeRemoved(node);
|
||||
}
|
||||
|
||||
QList<Node *> NodeGraph::TakeNodeWithItsDependencies(Node *node, QObject *new_parent)
|
||||
{
|
||||
if (!ContainsNode(node)) {
|
||||
return QList<Node*>();
|
||||
}
|
||||
|
||||
QList<Node*> deps = node->GetExclusiveDependencies();
|
||||
|
||||
foreach (Node* d, deps) {
|
||||
TakeNode(d, new_parent);
|
||||
}
|
||||
|
||||
return deps;
|
||||
}
|
||||
|
||||
const QList<Node *> &NodeGraph::nodes()
|
||||
{
|
||||
return node_children_;
|
||||
|
||||
Reference in New Issue
Block a user