Attica

forum.cpp
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 "forum.h"
10
11using namespace Attica;
12
13class Q_DECL_HIDDEN Forum::Private : public QSharedData
14{
15public:
16 QString m_id;
17 QString m_name;
18 QString m_description;
19 QDateTime m_date;
20 QUrl m_icon;
21 int m_childCount;
22 int m_topics;
23 QList<Forum> m_children;
24
25 Private()
26 : m_childCount(0)
27 , m_topics(0)
28 {
29 }
30};
31
32Forum::Forum()
33 : d(new Private)
34{
35}
36
37Forum::Forum(const Forum &other)
38 : d(other.d)
39{
40}
41
42Forum &Forum::operator=(const Attica::Forum &other)
43{
44 d = other.d;
45 return *this;
46}
47
48Forum::~Forum()
49{
50}
51
52void Forum::setId(const QString &id)
53{
54 d->m_id = id;
55}
56
57QString Forum::id() const
58{
59 return d->m_id;
60}
61
62void Forum::setName(const QString &name)
63{
64 d->m_name = name;
65}
66
67QString Forum::name() const
68{
69 return d->m_name;
70}
71
72void Forum::setDescription(const QString &description)
73{
74 d->m_description = description;
75}
76
77QString Forum::description() const
78{
79 return d->m_description;
80}
81
82void Forum::setDate(const QDateTime &date)
83{
84 d->m_date = date;
85}
86
87QDateTime Forum::date() const
88{
89 return d->m_date;
90}
91
92void Forum::setIcon(const QUrl &icon)
93{
94 d->m_icon = icon;
95}
96
97QUrl Forum::icon() const
98{
99 return d->m_icon;
100}
101
102void Forum::setChildCount(const int childCount)
103{
104 d->m_childCount = childCount;
105}
106
107int Forum::childCount() const
108{
109 return d->m_childCount;
110}
111
112void Forum::setChildren(QList<Forum> children)
113{
114 d->m_children = std::move(children); // TODO KF6 Make QList const & and remove the std::move
115}
116
117QList<Forum> Forum::children() const
118{
119 return d->m_children;
120}
121
122void Forum::setTopics(const int topics)
123{
124 d->m_topics = topics;
125}
126
127int Forum::topics() const
128{
129 return d->m_topics;
130}
131
132bool Forum::isValid() const
133{
134 return !(d->m_id.isEmpty());
135}
Represents a forum.
Definition forum.h:29
The Attica namespace,.
QString name(GameStandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:04:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.