Debian Codegraph @

src/libs/kernel/commands/ModifyResourceGroupOriginCmd.cpp

raw
1 /* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2022 Dag Andersen <[email protected]>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7 #include "ModifyResourceGroupOriginCmd.h"
8 #include "ResourceGroup.h"
9
10
11 using namespace KPlato;
12
13
14 ModifyResourceGroupOriginCmd::ModifyResourceGroupOriginCmd(ResourceGroup *group, bool newvalue, const KUndo2MagicString& name)
15 : NamedCommand(name)
16 , m_group(group)
17 , m_newvalue(newvalue)
18 {
19 }
20
21 void ModifyResourceGroupOriginCmd::execute()
22 {
23 m_group->setShared(m_newvalue);
24 }
25
26 void ModifyResourceGroupOriginCmd::unexecute()
27 {
28 m_group->setShared(!m_newvalue);
29 }