MCPcopy Create free account
hub / github.com/KDE/krita / setIndex

Method setIndex

libs/command/kundo2stack.cpp:550–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548*/
549
550void KUndo2QStack::setIndex(int idx, bool clean)
551{
552 bool was_clean = m_index == m_clean_index;
553
554 if (idx != m_index) {
555 m_index = idx;
556 Q_EMIT indexChanged(m_index);
557 Q_EMIT canUndoChanged(canUndo());
558 Q_EMIT undoTextChanged(undoText());
559 Q_EMIT canRedoChanged(canRedo());
560 Q_EMIT redoTextChanged(redoText());
561 }
562
563 if (clean)
564 m_clean_index = m_index;
565
566 bool is_clean = m_index == m_clean_index;
567 if (is_clean != was_clean)
568 Q_EMIT cleanChanged(is_clean);
569}
570
571void KUndo2QStack::purgeRedoState()
572{

Callers 2

setStackCurrentIndexMethod · 0.45
setStackCurrentIndexMethod · 0.45

Calls 6

setIndexFunction · 0.85
redoMergedCommandsMethod · 0.80
undoMergedCommandsMethod · 0.80
isEmptyMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected