| 1 |
/* This file is part of the KDE project |
| 2 |
* SPDX-FileCopyrightText: 2020 Dag Andersen <[email protected]> |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 |
*/ |
| 6 |
|
| 7 |
// clazy:excludeall=qstring-arg |
| 8 |
#include "SetFreedaysCalendarCmd.h" |
| 9 |
#include "kptproject.h" |
| 10 |
#include "kptcalendar.h" |
| 11 |
|
| 12 |
|
| 13 |
using namespace KPlato; |
| 14 |
|
| 15 |
|
| 16 |
SetFreedaysCalendarCmd::SetFreedaysCalendarCmd(Project *project, Calendar *newvalue, const KUndo2MagicString& name) |
| 17 |
: NamedCommand(name) |
| 18 |
, m_project(project) |
| 19 |
, m_newvalue(newvalue) |
| 20 |
{ |
| 21 |
} |
| 22 |
|
| 23 |
void SetFreedaysCalendarCmd::execute() |
| 24 |
{ |
| 25 |
m_project->setFreedaysCalendar(m_newvalue); |
| 26 |
} |
| 27 |
|
| 28 |
void SetFreedaysCalendarCmd::unexecute() |
| 29 |
{ |
| 30 |
m_project->setFreedaysCalendar(m_oldvalue); |
| 31 |
} |