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

Method clear

libs/command/kundo2stack.cpp:675–697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673*/
674
675void KUndo2QStack::clear()
676{
677 if (m_command_list.isEmpty())
678 return;
679
680 bool was_clean = isClean();
681
682 m_macro_stack.clear();
683 qDeleteAll(m_command_list);
684 m_command_list.clear();
685
686 m_index = 0;
687 m_clean_index = 0;
688
689 Q_EMIT indexChanged(0);
690 Q_EMIT canUndoChanged(false);
691 Q_EMIT undoTextChanged(QString());
692 Q_EMIT canRedoChanged(false);
693 Q_EMIT redoTextChanged(QString());
694
695 if (!was_clean)
696 Q_EMIT cleanChanged(true);
697}
698
699/*!
700 Pushes \a cmd on the stack or merges it with the most recently executed command.

Callers 4

~DeviceMethod · 0.45
~KisColordMethod · 0.45
serviceOwnerChangedMethod · 0.45
deviceChangedMethod · 0.45

Calls 2

QStringClass · 0.50
isEmptyMethod · 0.45

Tested by

no test coverage detected