MCPcopy Create free account
hub / github.com/MITK/MITK / SetOperationEvent

Method SetOperationEvent

Modules/Core/src/Controllers/mitkVerboseLimitedLinearUndo.cpp:24–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24bool mitk::VerboseLimitedLinearUndo::SetOperationEvent(UndoStackItem *undoStackItem)
25{
26 if (!undoStackItem)
27 return false;
28
29 // clear the redolist, if a new operation is saved
30 if (!m_RedoList.empty())
31 {
32 this->ClearList(&m_RedoList);
33 InvokeEvent(RedoEmptyEvent());
34 }
35
36 std::size_t undoLimit = this->GetUndoLimit();
37 if (0 != undoLimit && m_UndoList.size() == undoLimit)
38 {
39 auto item = m_UndoList.front();
40 m_UndoList.pop_front();
41 delete item;
42 }
43 m_UndoList.push_back(undoStackItem);
44
45 InvokeEvent(UndoNotEmptyEvent());
46
47 return true;
48}
49
50mitk::VerboseLimitedLinearUndo::StackDescription mitk::VerboseLimitedLinearUndo::GetUndoDescriptions()
51{

Callers

nothing calls this directly

Calls 5

ClearListMethod · 0.80
GetUndoLimitMethod · 0.80
frontMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected