@@ -25,9 +25,11 @@ void HistoryStore::appendAction( std::shared_ptr<HistoryAction> action )
2525 return ;
2626 if ( !action )
2727 return ;
28+ changedSignal ( *this , ChangeType::PreAppendAction, action );
2829 if ( scopedBlock_ )
2930 {
3031 scopedBlock_->push_back ( std::move ( action ) );
32+ changedSignal ( *this , ChangeType::PostAppendAction, scopedBlock_->back () );
3133 return ;
3234 }
3335 spdlog::info ( " History action append: \" {}\" " , action->name () );
@@ -37,7 +39,7 @@ void HistoryStore::appendAction( std::shared_ptr<HistoryAction> action )
3739 stack_[firstRedoIndex_] = std::move ( action );
3840 ++firstRedoIndex_;
3941
40- changedSignal ( *this , ChangeType::AppendAction );
42+ changedSignal ( *this , ChangeType::PostAppendAction, stack_. back () );
4143
4244 filterByMemoryLimit_ ();
4345}
@@ -52,7 +54,7 @@ void HistoryStore::clear()
5254 spdlog::info ( " History store clear" );
5355 stack_.clear ();
5456 firstRedoIndex_ = 0 ;
55- changedSignal ( *this , ChangeType::Clear );
57+ changedSignal ( *this , ChangeType::Clear, {} );
5658}
5759
5860void HistoryStore::filterStack ( HistoryStackFilter filteringCondition, bool deepFiltering /* = true*/ )
@@ -63,7 +65,7 @@ void HistoryStore::filterStack( HistoryStackFilter filteringCondition, bool deep
6365 const auto [needSignal, redoDecrease] = filterHistoryActionsVector ( stack_, filteringCondition, firstRedoIndex_, deepFiltering );
6466 firstRedoIndex_ -= redoDecrease;
6567 if ( needSignal )
66- changedSignal ( *this , ChangeType::Filter );
68+ changedSignal ( *this , ChangeType::Filter, {} );
6769}
6870
6971bool HistoryStore::undo ()
@@ -80,11 +82,11 @@ bool HistoryStore::undo()
8082 if ( stack_[firstRedoIndex_ - 1 ] )
8183 {
8284 spdlog::info ( " History action undo: \" {}\" " , stack_[firstRedoIndex_ - 1 ]->name () );
83- changedSignal ( *this , ChangeType::PreUndo );
85+ changedSignal ( *this , ChangeType::PreUndo, stack_[firstRedoIndex_ - 1 ] );
8486 stack_[firstRedoIndex_ - 1 ]->action ( HistoryAction::Type::Undo );
8587 }
8688 --firstRedoIndex_;
87- changedSignal ( *this , ChangeType::PostUndo );
89+ changedSignal ( *this , ChangeType::PostUndo, stack_[firstRedoIndex_] );
8890 return true ;
8991}
9092
@@ -101,11 +103,11 @@ bool HistoryStore::redo()
101103 if ( stack_[firstRedoIndex_] )
102104 {
103105 spdlog::info ( " History action redo: \" {}\" " , stack_[firstRedoIndex_]->name () );
104- changedSignal ( *this , ChangeType::PreRedo );
106+ changedSignal ( *this , ChangeType::PreRedo, stack_[firstRedoIndex_] );
105107 stack_[firstRedoIndex_]->action ( HistoryAction::Type::Redo );
106108 }
107109 ++firstRedoIndex_;
108- changedSignal ( *this , ChangeType::PostRedo );
110+ changedSignal ( *this , ChangeType::PostRedo, stack_[firstRedoIndex_ - 1 ] );
109111 return true ;
110112}
111113
@@ -167,7 +169,7 @@ void HistoryStore::filterByMemoryLimit_()
167169 stack_.erase ( stack_.begin () );
168170 --firstRedoIndex_;
169171 --savedSceneIndex_;
170- changedSignal ( *this , ChangeType::PopAction );
172+ changedSignal ( *this , ChangeType::PopAction, nullptr );
171173 }
172174}
173175
0 commit comments