| 19 | } |
| 20 | |
| 21 | void HistoryStore::appendAction( std::shared_ptr<HistoryAction> action ) |
| 22 | { |
| 23 | assert( !undoRedoInProgress_ ); |
| 24 | if ( undoRedoInProgress_ ) |
| 25 | return; |
| 26 | if ( !action ) |
| 27 | return; |
| 28 | changedSignal( *this, ChangeType::PreAppendAction, action ); |
| 29 | if ( scopedBlock_ ) |
| 30 | { |
| 31 | scopedBlock_->push_back( std::move( action ) ); |
| 32 | changedSignal( *this, ChangeType::PostAppendAction, scopedBlock_->back() ); |
| 33 | return; |
| 34 | } |
| 35 | spdlog::info( "History action append: \"{}\"", action->name() ); |
| 36 | assert( !action->name().empty() ); |
| 37 | |
| 38 | stack_.resize( firstRedoIndex_ + 1 ); |
| 39 | stack_[firstRedoIndex_] = std::move( action ); |
| 40 | ++firstRedoIndex_; |
| 41 | |
| 42 | changedSignal( *this, ChangeType::PostAppendAction, stack_.back() ); |
| 43 | |
| 44 | filterByMemoryLimit_(); |
| 45 | } |
| 46 | |
| 47 | void HistoryStore::clear() |
| 48 | { |
no test coverage detected