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

Method SetOperationEvent

Modules/Core/src/Controllers/mitkLimitedLinearUndo.cpp:50–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50bool mitk::LimitedLinearUndo::SetOperationEvent(UndoStackItem *stackItem)
51{
52 auto *operationEvent = dynamic_cast<OperationEvent *>(stackItem);
53 if (!operationEvent)
54 return false;
55
56 // clear the redolist, if a new operation is saved
57 if (!m_RedoList.empty())
58 {
59 this->ClearList(&m_RedoList);
60 InvokeEvent(RedoEmptyEvent());
61 }
62
63 if (0 != m_UndoLimit && m_UndoList.size() == m_UndoLimit)
64 {
65 auto item = m_UndoList.front();
66 m_UndoList.pop_front();
67 delete item;
68 }
69 m_UndoList.push_back(operationEvent);
70
71 InvokeEvent(UndoNotEmptyEvent());
72
73 return true;
74}
75
76bool mitk::LimitedLinearUndo::Undo(bool fine)
77{

Callers

nothing calls this directly

Calls 4

ClearListMethod · 0.95
frontMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected