Krita Source Code Documentation
Loading...
Searching...
No Matches
KisDirtyStateSaver.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6#ifndef KISDIRTYSTATESAVER_H
7#define KISDIRTYSTATESAVER_H
8
9#include <KoResource.h>
10
11#include "kritaresources_export.h"
18template <typename T>
20{
21public:
23 : m_resource(resource)
24 , m_isDirty(resource->isDirty())
25
26 {
27 }
28
30 if (m_resource) {
31 m_resource->setDirty(m_isDirty);
32 }
33 }
34
35private:
37 bool m_isDirty = false;
38};
39
40#endif // KISDIRTYSTATESAVER_H
KisDirtyStateSaver(T resource)