Attica

knowledgebaseentry.cpp
1 /*
2  This file is part of KDE.
3 
4  SPDX-FileCopyrightText: 2009 Marco Martin <[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 "knowledgebaseentry.h"
10 
11 
12 using namespace Attica;
13 
14 class KnowledgeBaseEntry::Private : public QSharedData
15 {
16 public:
17  QString m_id;
18  int m_contentId;
19  QString m_user;
20  QString m_status;
21  QDateTime m_changed;
22  QString m_name;
23  QString m_description;
24  QString m_answer;
25  int m_comments;
26  QUrl m_detailPage;
27 
28  QMap<QString, QString> m_extendedAttributes;
29 
30  Private()
31  : m_contentId(0),
32  m_comments(0)
33  {
34  }
35 };
36 
37 KnowledgeBaseEntry::KnowledgeBaseEntry()
38  : d(new Private)
39 {
40 }
41 
42 KnowledgeBaseEntry::KnowledgeBaseEntry(const KnowledgeBaseEntry &other)
43  : d(other.d)
44 {
45 }
46 
47 KnowledgeBaseEntry &KnowledgeBaseEntry::operator=(const Attica::KnowledgeBaseEntry &other)
48 {
49  d = other.d;
50  return *this;
51 }
52 
53 KnowledgeBaseEntry::~KnowledgeBaseEntry()
54 {
55 }
56 
57 void KnowledgeBaseEntry::setId(QString id)
58 {
59  d->m_id = std::move(id); // TODO KF6 Make QString const & and remove the std::move
60 }
61 
62 QString KnowledgeBaseEntry::id() const
63 {
64  return d->m_id;
65 }
66 
67 void KnowledgeBaseEntry::setContentId(int id)
68 {
69  d->m_contentId = id;
70 }
71 
72 int KnowledgeBaseEntry::contentId() const
73 {
74  return d->m_contentId;
75 }
76 
77 void KnowledgeBaseEntry::setUser(const QString &user)
78 {
79  d->m_user = user;
80 }
81 
82 QString KnowledgeBaseEntry::user() const
83 {
84  return d->m_user;
85 }
86 
87 void KnowledgeBaseEntry::setStatus(const QString &status)
88 {
89  d->m_status = status;
90 }
91 
92 QString KnowledgeBaseEntry::status() const
93 {
94  return d->m_status;
95 }
96 
97 void KnowledgeBaseEntry::setChanged(const QDateTime &changed)
98 {
99  d->m_changed = changed;
100 }
101 
102 QDateTime KnowledgeBaseEntry::changed() const
103 {
104  return d->m_changed;
105 }
106 
107 void KnowledgeBaseEntry::setName(const QString &name)
108 {
109  d->m_name = name;
110 }
111 
112 QString KnowledgeBaseEntry::name() const
113 {
114  return d->m_name;
115 }
116 
117 void KnowledgeBaseEntry::setDescription(const QString &description)
118 {
119  d->m_description = description;
120 }
121 
122 QString KnowledgeBaseEntry::description() const
123 {
124  return d->m_description;
125 }
126 
127 void KnowledgeBaseEntry::setAnswer(const QString &answer)
128 {
129  d->m_answer = answer;
130 }
131 
132 QString KnowledgeBaseEntry::answer() const
133 {
134  return d->m_answer;
135 }
136 
137 void KnowledgeBaseEntry::setComments(int comments)
138 {
139  d->m_comments = comments;
140 }
141 
142 int KnowledgeBaseEntry::comments() const
143 {
144  return d->m_comments;
145 }
146 
147 void KnowledgeBaseEntry::setDetailPage(const QUrl &detailPage)
148 {
149  d->m_detailPage = detailPage;
150 }
151 
152 QUrl KnowledgeBaseEntry::detailPage() const
153 {
154  return d->m_detailPage;
155 }
156 
157 void KnowledgeBaseEntry::addExtendedAttribute(const QString &key, const QString &value)
158 {
159  d->m_extendedAttributes.insert(key, value);
160 }
161 
162 QString KnowledgeBaseEntry::extendedAttribute(const QString &key) const
163 {
164  return d->m_extendedAttributes.value(key);
165 }
166 
167 QMap<QString, QString> KnowledgeBaseEntry::extendedAttributes() const
168 {
169  return d->m_extendedAttributes;
170 }
171 
172 bool KnowledgeBaseEntry::isValid() const
173 {
174  return !(d->m_id.isEmpty());
175 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 23:06:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.