remove null context commands

This commit is contained in:
itsmattkc
2021-05-27 15:14:28 +10:00
parent 4b14352bcb
commit 24ce8f8446
2 changed files with 2 additions and 9 deletions
+2 -8
View File
@@ -2326,15 +2326,9 @@ void NodeSetPositionAsChildCommand::redo()
sub_command_ = new MultiUndoCommand();
if (shift_surroundings_) {
if (relative_) {
sub_command_->add_child(new NodeSetPositionAndShiftSurroundingsCommand(node_, relative_, pos, true));
}
sub_command_->add_child(new NodeSetPositionAndShiftSurroundingsCommand(node_, nullptr, pos, true));
sub_command_->add_child(new NodeSetPositionAndShiftSurroundingsCommand(node_, relative_, pos, true));
} else {
if (relative_) {
sub_command_->add_child(new NodeSetPositionCommand(node_, relative_, pos, true));
}
sub_command_->add_child(new NodeSetPositionCommand(node_, nullptr, pos, true));
sub_command_->add_child(new NodeSetPositionCommand(node_, relative_, pos, true));
}
}
@@ -387,7 +387,6 @@ void ImportTool::DropGhosts(bool insert)
clip->set_length_and_media_out(ghost->GetLength());
clip->SetLabel(footage_stream.footage->GetLabel());
command->add_child(new NodeAddCommand(dst_graph, clip));
command->add_child(new NodeSetPositionToOffsetOfAnotherNodeCommand(clip, footage_stream.footage, nullptr, QPointF(2, 0)));
// Position clip in its own context
command->add_child(new NodeSetPositionCommand(clip, clip, QPointF(0, 0), false));