Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_processing_visitor.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 <KoUpdater.h>
10#include <KoProgressUpdater.h>
12#include "kis_node.h"
13#include <KLocalizedString>
14#include <QTimer>
15
17{
18 KIS_ASSERT(node);
19 KisNodeProgressProxy *progressProxy = node->nodeProgressProxy();
20
21 if(progressProxy) {
22 m_progressUpdater = new KoProgressUpdater(progressProxy);
23 m_progressUpdater->setObjectName("ProgressHelper::m_progressUpdater");
24 m_progressUpdater->start(100, i18n("Processing"));
25 m_progressUpdater->moveToThread(node->thread());
26 }
27 else {
29 }
30}
31
33{
34 if (m_progressUpdater) {
35 m_progressUpdater->deleteLater();
36 }
37}
38
40{
41 return m_progressUpdater ? m_progressUpdater->startSubtask() : 0;
42}
43
45{
46 if (m_progressUpdater) {
47 QTimer::singleShot(0, m_progressUpdater, &KoProgressUpdater::cancel);
48 }
49}
50
54
virtual KUndo2Command * createInitCommand()
void start(int range=100, const QString &text="")
#define KIS_ASSERT(cond)
Definition kis_assert.h:33
KisNodeProgressProxy * nodeProgressProxy
Definition kis_node.cpp:89