File indexing completed on 2023-09-24 07:57:26
0001 /* 0002 This file is part of KDE. 0003 0004 SPDX-FileCopyrightText: 2011 Laszlo Papp <djszapi@archlinux.us> 0005 0006 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0007 */ 0008 0009 #include "forum.h" 0010 0011 using namespace Attica; 0012 0013 class Q_DECL_HIDDEN Forum::Private : public QSharedData 0014 { 0015 public: 0016 QString m_id; 0017 QString m_name; 0018 QString m_description; 0019 QDateTime m_date; 0020 QUrl m_icon; 0021 int m_childCount; 0022 int m_topics; 0023 QList<Forum> m_children; 0024 0025 Private() 0026 : m_childCount(0) 0027 , m_topics(0) 0028 { 0029 } 0030 }; 0031 0032 Forum::Forum() 0033 : d(new Private) 0034 { 0035 } 0036 0037 Forum::Forum(const Forum &other) 0038 : d(other.d) 0039 { 0040 } 0041 0042 Forum &Forum::operator=(const Attica::Forum &other) 0043 { 0044 d = other.d; 0045 return *this; 0046 } 0047 0048 Forum::~Forum() 0049 { 0050 } 0051 0052 void Forum::setId(const QString &id) 0053 { 0054 d->m_id = id; 0055 } 0056 0057 QString Forum::id() const 0058 { 0059 return d->m_id; 0060 } 0061 0062 void Forum::setName(const QString &name) 0063 { 0064 d->m_name = name; 0065 } 0066 0067 QString Forum::name() const 0068 { 0069 return d->m_name; 0070 } 0071 0072 void Forum::setDescription(const QString &description) 0073 { 0074 d->m_description = description; 0075 } 0076 0077 QString Forum::description() const 0078 { 0079 return d->m_description; 0080 } 0081 0082 void Forum::setDate(const QDateTime &date) 0083 { 0084 d->m_date = date; 0085 } 0086 0087 QDateTime Forum::date() const 0088 { 0089 return d->m_date; 0090 } 0091 0092 void Forum::setIcon(const QUrl &icon) 0093 { 0094 d->m_icon = icon; 0095 } 0096 0097 QUrl Forum::icon() const 0098 { 0099 return d->m_icon; 0100 } 0101 0102 void Forum::setChildCount(const int childCount) 0103 { 0104 d->m_childCount = childCount; 0105 } 0106 0107 int Forum::childCount() const 0108 { 0109 return d->m_childCount; 0110 } 0111 0112 void Forum::setChildren(QList<Forum> children) 0113 { 0114 d->m_children = std::move(children); // TODO KF6 Make QList const & and remove the std::move 0115 } 0116 0117 QList<Forum> Forum::children() const 0118 { 0119 return d->m_children; 0120 } 0121 0122 void Forum::setTopics(const int topics) 0123 { 0124 d->m_topics = topics; 0125 } 0126 0127 int Forum::topics() const 0128 { 0129 return d->m_topics; 0130 } 0131 0132 bool Forum::isValid() const 0133 { 0134 return !(d->m_id.isEmpty()); 0135 }