2
This file is part of KDE.
4
Copyright (C) 2009 Marco Martin <notmart@gmail.com>
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2.1 of the License, or (at your option) version 3, or any
10
later version accepted by the membership of KDE e.V. (or its
11
successor approved by the membership of KDE e.V.), which shall
12
act as a proxy defined in Section 6 of version 3 of the license.
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Lesser General Public License for more details.
19
You should have received a copy of the GNU Lesser General Public
20
License along with this library. If not, see <http://www.gnu.org/licenses/>.
24
#include "knowledgebaseentry.h"
28
using namespace Attica;
30
class KnowledgeBaseEntry::Private : public QSharedData
39
QString m_description;
44
QMap<QString, QString> m_extendedAttributes;
53
KnowledgeBaseEntry::KnowledgeBaseEntry()
58
KnowledgeBaseEntry::KnowledgeBaseEntry(const KnowledgeBaseEntry &other)
63
KnowledgeBaseEntry &KnowledgeBaseEntry::operator=(const Attica::KnowledgeBaseEntry &other)
69
KnowledgeBaseEntry::~KnowledgeBaseEntry()
73
void KnowledgeBaseEntry::setId(QString id)
78
QString KnowledgeBaseEntry::id() const
83
void KnowledgeBaseEntry::setContentId(int id)
88
int KnowledgeBaseEntry::contentId() const
90
return d->m_contentId;
93
void KnowledgeBaseEntry::setUser(const QString &user)
98
QString KnowledgeBaseEntry::user() const
103
void KnowledgeBaseEntry::setStatus(const QString &status)
105
d->m_status = status;
108
QString KnowledgeBaseEntry::status() const
113
void KnowledgeBaseEntry::setChanged(const QDateTime &changed)
115
d->m_changed = changed;
118
QDateTime KnowledgeBaseEntry::changed() const
123
void KnowledgeBaseEntry::setName(const QString &name)
128
QString KnowledgeBaseEntry::name() const
133
void KnowledgeBaseEntry::setDescription(const QString &description)
135
d->m_description = description;
138
QString KnowledgeBaseEntry::description() const
140
return d->m_description;
143
void KnowledgeBaseEntry::setAnswer(const QString &answer)
145
d->m_answer = answer;
148
QString KnowledgeBaseEntry::answer() const
153
void KnowledgeBaseEntry::setComments(int comments)
155
d->m_comments = comments;
158
int KnowledgeBaseEntry::comments() const
160
return d->m_comments;
163
void KnowledgeBaseEntry::setDetailPage(const QUrl &detailPage)
165
d->m_detailPage = detailPage;
168
QUrl KnowledgeBaseEntry::detailPage() const
170
return d->m_detailPage;
173
void KnowledgeBaseEntry::addExtendedAttribute(const QString &key, const QString &value)
175
d->m_extendedAttributes.insert(key, value);
178
QString KnowledgeBaseEntry::extendedAttribute(const QString &key) const
180
return d->m_extendedAttributes.value(key);
183
QMap<QString, QString> KnowledgeBaseEntry::extendedAttributes() const
185
return d->m_extendedAttributes;
188
bool KnowledgeBaseEntry::isValid() const
190
return !(d->m_id.isEmpty());