Debian Codegraph @

src/libs/kernel/commands/RemoveParentGroupCmd.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 "RemoveParentGroupCmd.h"
9
10 #include "Resource.h"
11 #include "ResourceGroup.h"
12
13 using namespace KPlato;
14
15
16 RemoveParentGroupCmd::RemoveParentGroupCmd(Resource *resource, ResourceGroup *group, const KUndo2MagicString& name)
17 : NamedCommand(name)
18 , m_resource(resource)
19 , m_group(group)
20 {
21 }
22
23 RemoveParentGroupCmd::~RemoveParentGroupCmd()
24 {
25 }
26
27 void RemoveParentGroupCmd::execute()
28 {
29 m_resource->removeParentGroup(m_group);
30 }
31
32 void RemoveParentGroupCmd::unexecute()
33 {
34 m_resource->addParentGroup(m_group);
35 }