Kgapi

task.cpp
1/*
2 * This file is part of LibKGAPI library
3 *
4 * SPDX-FileCopyrightText: 2013 Daniel Vrátil <dvratil@redhat.com>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8
9#include "task.h"
10#include "debug.h"
11
12using namespace KGAPI2;
13
14class Q_DECL_HIDDEN Task::Private
15{
16public:
17 Private() = default;
18 Private(const Private &other) = default;
19
20 bool deleted = false;
21};
22
24 : Object()
25 , KCalendarCore::Todo()
26 , d(new Private)
27{
28}
29
30Task::Task(const Task &other)
31 : Object(other)
32 , KCalendarCore::Todo(other)
33 , d(new Private(*(other.d.get())))
34{
35}
36
38 : Object()
39 , KCalendarCore::Todo(other)
40 , d(new Private)
41{
42}
43
44Task::~Task() = default;
45
46bool Task::operator==(const Task &other) const
47{
48 if (!Object::operator==(other)) {
49 qCDebug(KGAPIDebug) << "Objects don't match";
50 return false;
51 }
52 if (!Todo::operator==(other)) {
53 qCDebug(KGAPIDebug) << "Todos don't match";
54 return false;
55 }
56 if (d->deleted != other.d->deleted) {
57 qCDebug(KGAPIDebug) << "Deleted does not match";
58 return false;
59 }
60
61 return true;
62}
63
64void Task::setDeleted(const bool deleted)
65{
66 d->deleted = deleted;
67}
68
69bool Task::deleted() const
70{
71 return d->deleted;
72}
Base class for all objects.
Definition object.h:31
Represents a single task (or todo)
Definition task.h:29
Task()
Constructor.
Definition task.cpp:23
void setDeleted(bool deleted)
Sets whether the task has been deleted.
Definition task.cpp:64
bool deleted() const
Returns whether the task has been deleted.
Definition task.cpp:69
~Task() override
Destructor.
A job to fetch a single map tile described by a StaticMapUrl.
Definition blog.h:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:52 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.