Debian Codegraph @

src/libs/kernel/commands/ProjectModifyTimeZoneCmd.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 "ProjectModifyTimeZoneCmd.h"
8
9 #include "kptproject.h"
10
11 using namespace KPlato;
12
13 ProjectModifyTimeZoneCmd::ProjectModifyTimeZoneCmd(Project &project, const QTimeZone &tz, const KUndo2MagicString& name)
14 : NamedCommand(name)
15 , m_project(project)
16 , m_oldtz(project.timeZone())
17 , m_newtz(tz)
18 {
19 }
20
21 ProjectModifyTimeZoneCmd::~ProjectModifyTimeZoneCmd()
22 {
23 }
24
25 void ProjectModifyTimeZoneCmd::execute()
26 {
27 m_project.setTimeZone(m_newtz);
28 }
29
30 void ProjectModifyTimeZoneCmd::unexecute()
31 {
32 m_project.setTimeZone(m_oldtz);
33 }