diff --git a/app/dialog/speedduration/speedduration.cpp b/app/dialog/speedduration/speedduration.cpp index 1c279ae86..7ad38dac3 100644 --- a/app/dialog/speedduration/speedduration.cpp +++ b/app/dialog/speedduration/speedduration.cpp @@ -210,7 +210,7 @@ void SpeedDurationDialog::accept() GapBlock* gap = new GapBlock(); gap->set_length_and_media_out(gap_length); new NodeAddCommand(static_cast(clip->parent()), gap, command); - new TrackInsertBlockBetweenBlocksCommand(TrackOutput::TrackFromBlock(clip), gap, clip, next_block, command); + new TrackInsertBlockAfterCommand(TrackOutput::TrackFromBlock(clip), gap, clip, command); } } } diff --git a/app/node/input.cpp b/app/node/input.cpp index 8dc05f412..a401947fa 100644 --- a/app/node/input.cpp +++ b/app/node/input.cpp @@ -273,6 +273,7 @@ QVariant NodeInput::StringToValue(const QString &string, QList(ghost->data(TimelineViewGhostItem::kReferenceBlock)); - new TrackInsertBlockBetweenBlocksCommand(parent()->GetTrackFromReference(ghost->Track()), - gap, - block_to_append_gap_to, - block_to_append_gap_to->next(), - command); + new TrackInsertBlockAfterCommand(parent()->GetTrackFromReference(ghost->Track()), + gap, + block_to_append_gap_to, + command); } } else { // This was a Block that already existed diff --git a/app/widget/timelinewidget/undo/undo.cpp b/app/widget/timelinewidget/undo/undo.cpp index dd46cbf8f..39fe66494 100644 --- a/app/widget/timelinewidget/undo/undo.cpp +++ b/app/widget/timelinewidget/undo/undo.cpp @@ -106,25 +106,23 @@ void TrackRippleRemoveBlockCommand::undo() } } -TrackInsertBlockBetweenBlocksCommand::TrackInsertBlockBetweenBlocksCommand(TrackOutput *track, +TrackInsertBlockAfterCommand::TrackInsertBlockAfterCommand(TrackOutput *track, Block *block, Block *before, - Block *after, QUndoCommand *parent) : QUndoCommand(parent), track_(track), block_(block), - before_(before), - after_(after) + before_(before) { } -void TrackInsertBlockBetweenBlocksCommand::redo() +void TrackInsertBlockAfterCommand::redo() { track_->InsertBlockAfter(block_, before_); } -void TrackInsertBlockBetweenBlocksCommand::undo() +void TrackInsertBlockAfterCommand::undo() { track_->RippleRemoveBlock(block_); } diff --git a/app/widget/timelinewidget/undo/undo.h b/app/widget/timelinewidget/undo/undo.h index e2e91dc88..309b64f4d 100644 --- a/app/widget/timelinewidget/undo/undo.h +++ b/app/widget/timelinewidget/undo/undo.h @@ -108,9 +108,9 @@ private: Block* block_; }; -class TrackInsertBlockBetweenBlocksCommand : public QUndoCommand { +class TrackInsertBlockAfterCommand : public QUndoCommand { public: - TrackInsertBlockBetweenBlocksCommand(TrackOutput* track, Block* block, Block* before, Block* after, QUndoCommand* parent = nullptr); + TrackInsertBlockAfterCommand(TrackOutput* track, Block* block, Block* before, QUndoCommand* parent = nullptr); virtual void redo() override; virtual void undo() override; @@ -121,7 +121,6 @@ private: Block* block_; Block* before_; - Block* after_; }; /**