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 class Q_DECL_HIDDEN Task::Private
15 {
16 public:
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 
30 Task::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 
44 Task::~Task() = default;
45 
46 bool 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 
64 void Task::setDeleted(const bool deleted)
65 {
66  d->deleted = deleted;
67 }
68 
69 bool Task::deleted() const
70 {
71  return d->deleted;
72 }
Represents a single task (or todo)
Definition: task.h:28
void setDeleted(bool deleted)
Sets whether the task has been deleted.
Definition: task.cpp:64
~Task() override
Destructor.
Base class for all objects.
Definition: object.h:30
A job to fetch a single map tile described by a StaticMapUrl.
Definition: blog.h:15
bool deleted() const
Returns whether the task has been deleted.
Definition: task.cpp:69
Task()
Constructor.
Definition: task.cpp:23
virtual QVariant get(ScriptableExtension *callerPrincipal, quint64 objId, const QString &propName)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 2 2023 03:53:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.