1/*
2 This file is part of KDE.
3
4 SPDX-FileCopyrightText: 2011 Laszlo Papp <djszapi@archlinux.us>
5
6 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7*/
8
9#include "topic.h"
10
11using namespace Attica;
12
13class Q_DECL_HIDDEN Topic::Private : public QSharedData
14{
15public:
16 QString m_id;
17 QString m_forumId;
18 QString m_user;
19 QDateTime m_date;
20 QString m_subject;
21 QString m_content;
22 int m_comments;
23
24 Private()
25 : m_comments(0)
26 {
27 }
28};
29
30Topic::Topic()
31 : d(new Private)
32{
33}
34
35Topic::Topic(const Topic &other)
36 : d(other.d)
37{
38}
39
40Topic &Topic::operator=(const Topic &other)
41{
42 d = other.d;
43 return *this;
44}
45
46Topic::~Topic()
47{
48}
49
50void Topic::setId(const QString &id)
51{
52 d->m_id = id;
53}
54
55QString Topic::id() const
56{
57 return d->m_id;
58}
59
60void Topic::setForumId(const QString &forumId)
61{
62 d->m_forumId = forumId;
63}
64
65QString Topic::forumId() const
66{
67 return d->m_forumId;
68}
69
70void Topic::setUser(const QString &user)
71{
72 d->m_user = user;
73}
74
75QString Topic::user() const
76{
77 return d->m_user;
78}
79
80void Topic::setDate(const QDateTime &date)
81{
82 d->m_date = date;
83}
84
85QDateTime Topic::date() const
86{
87 return d->m_date;
88}
89
90void Topic::setSubject(const QString &subject)
91{
92 d->m_subject = subject;
93}
94
95QString Topic::subject() const
96{
97 return d->m_subject;
98}
99
100void Topic::setContent(const QString &content)
101{
102 d->m_content = content;
103}
104
105QString Topic::content() const
106{
107 return d->m_content;
108}
109
110void Topic::setComments(const int comments)
111{
112 d->m_comments = comments;
113}
114
115int Topic::comments() const
116{
117 return d->m_comments;
118}
119
120bool Topic::isValid() const
121{
122 return !(d->m_id.isEmpty());
123}
124

source code of attica/src/topic.cpp