Debian Codegraph @

src/libs/kernel/commands/AddParentGroupCmd.cpp

raw
1 /* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2019 Dag Andersen <[email protected]>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7 // clazy:excludeall=qstring-arg
8 #include "AddParentGroupCmd.h"
9
10 #include "Resource.h"
11 #include "ResourceGroup.h"
12
13 using namespace KPlato;
14
15
16 AddParentGroupCmd::AddParentGroupCmd(Resource *resource, ResourceGroup *group, const KUndo2MagicString& name)
17 : NamedCommand(name)
18 , m_resource(resource)
19 , m_group(group)
20 {
21 }
22
23 AddParentGroupCmd::~AddParentGroupCmd()
24 {
25 }
26
27 void AddParentGroupCmd::execute()
28 {
29 m_resource->addParentGroup(m_group);
30 }
31
32 void AddParentGroupCmd::unexecute()
33 {
34 m_group->takeResource(m_resource);
35 }