Kgapi

task.cpp
1 /*
2  * This file is part of LibKGAPI library
3  *
4  * SPDX-FileCopyrightText: 2013 Daniel Vr├ítil <[email protected]>
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 
12 using namespace KGAPI2;
13 
14 
15 class Q_DECL_HIDDEN Task::Private
16 {
17 
18  public:
19  Private() = default;
20  Private(const Private &other) = default;
21 
22  bool deleted = false;
23 };
24 
25 
27  Object(),
28  KCalendarCore::Todo(),
29  d(new Private)
30 {
31 }
32 
33 Task::Task(const Task& other):
34  Object(other),
35  KCalendarCore::Todo(other),
36  d(new Private(*(other.d.get())))
37 {
38 }
39 
41  Object(),
42  KCalendarCore::Todo(other),
43  d(new Private)
44 {
45 }
46 
47 Task::~Task() = default;
48 
49 bool Task::operator==(const Task &other) const
50 {
51  if (!Object::operator==(other)) {
52  qCDebug(KGAPIDebug) << "Objects don't match";
53  return false;
54  }
55  if (!Todo::operator==(other)) {
56  qCDebug(KGAPIDebug) << "Todos don't match";
57  return false;
58  }
59  if (d->deleted != other.d->deleted) {
60  qCDebug(KGAPIDebug) << "Deleted does not match";
61  return false;
62  }
63 
64  return true;
65 }
66 
67 
68 void Task::setDeleted(const bool deleted)
69 {
70  d->deleted = deleted;
71 }
72 
73 bool Task::deleted() const
74 {
75  return d->deleted;
76 }
Base class for all objects.
Definition: object.h:30
bool deleted() const
Returns whether the task has been deleted.
Definition: task.cpp:73
Task()
Constructor.
Definition: task.cpp:26
A job to fetch a single map tile described by a StaticMapUrl.
Definition: blog.h:15
Represents a single task (or todo)
Definition: task.h:28
~Task() override
Destructor.
void setDeleted(bool deleted)
Sets whether the task has been deleted.
Definition: task.cpp:68
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Oct 18 2021 23:13:45 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.