Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_document_undo_store.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2011 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
8
9#include "KisDocument.h"
10#include <kundo2stack.h>
11
12
13/*****************************************************************/
14/* KisDocumentUndoStore */
15/*****************************************************************/
16
18 : m_doc(doc)
19{
22 KIS_SAFE_ASSERT_RECOVER_NOOP(doc->thread() == this->thread());
23
24 // Use direct connection to avoid queueing the signal forwarding (BUG:447985)
25 connect(doc->undoStack(), SIGNAL(indexChanged(int)), this, SIGNAL(historyStateChanged()), Qt::DirectConnection);
26}
27
32
50
52{
53 if(!command) return;
54 m_doc->undoStack()->push(command);
55}
56
58{
59 m_doc->undoStack()->beginMacro(macroName);
60}
61
66
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void beginMacro(const KUndo2MagicString &text)
virtual void undo()
void push(KUndo2Command *cmd)
int index() const
void purgeRedoState()
const KUndo2Command * command(int index) const
KisDocumentUndoStore(KisDocument *doc)
void beginMacro(const KUndo2MagicString &macroName) override
void addCommand(KUndo2Command *cmd) override
const KUndo2Command * presentCommand() override
KUndo2Stack * undoStack
void historyStateChanged()
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130