Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_node_uuid_info.cpp
Go to the documentation of this file.
1/*
2 * Clone info stores information about clone layer's target
3 * SPDX-FileCopyrightText: 2011 Torio Mlshi <mlshi@lavabit.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
9
10#include "kis_debug.h"
11
15
17{
18 m_uuid = uuid;
19}
20
22{
23 m_name = name;
24}
25
27{
28 m_uuid = node->uuid();
29 m_name = node->name();
30}
31
33{
34 if (check(rootNode))
35 return rootNode;
36
37 KisNodeSP child = rootNode->firstChild();
38 KisNodeSP node = 0;
39 while (child && !node)
40 {
41 node = findNode(child);
42 child = child->nextSibling();
43 }
44 return node;
45}
46
48{
49 if (m_uuid == node->uuid()) // every node has valid uuid
50 return true;
51 if (m_uuid.isNull() && m_name == node->name()) // but some may have empty names
52 return true;
53 return false;
54}
bool check(KisNodeSP node)
KisNodeSP findNode(KisNodeSP rootNode)
QUuid uuid() const
QString name() const
KisNodeSP firstChild() const
Definition kis_node.cpp:361
KisNodeSP nextSibling() const
Definition kis_node.cpp:408