File indexing completed on 2024-09-15 11:53:43
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 "topic.h" 0010 0011 using namespace Attica; 0012 0013 class Q_DECL_HIDDEN Topic::Private : public QSharedData 0014 { 0015 public: 0016 QString m_id; 0017 QString m_forumId; 0018 QString m_user; 0019 QDateTime m_date; 0020 QString m_subject; 0021 QString m_content; 0022 int m_comments; 0023 0024 Private() 0025 : m_comments(0) 0026 { 0027 } 0028 }; 0029 0030 Topic::Topic() 0031 : d(new Private) 0032 { 0033 } 0034 0035 Topic::Topic(const Topic &other) 0036 : d(other.d) 0037 { 0038 } 0039 0040 Topic &Topic::operator=(const Topic &other) 0041 { 0042 d = other.d; 0043 return *this; 0044 } 0045 0046 Topic::~Topic() 0047 { 0048 } 0049 0050 void Topic::setId(const QString &id) 0051 { 0052 d->m_id = id; 0053 } 0054 0055 QString Topic::id() const 0056 { 0057 return d->m_id; 0058 } 0059 0060 void Topic::setForumId(const QString &forumId) 0061 { 0062 d->m_forumId = forumId; 0063 } 0064 0065 QString Topic::forumId() const 0066 { 0067 return d->m_forumId; 0068 } 0069 0070 void Topic::setUser(const QString &user) 0071 { 0072 d->m_user = user; 0073 } 0074 0075 QString Topic::user() const 0076 { 0077 return d->m_user; 0078 } 0079 0080 void Topic::setDate(const QDateTime &date) 0081 { 0082 d->m_date = date; 0083 } 0084 0085 QDateTime Topic::date() const 0086 { 0087 return d->m_date; 0088 } 0089 0090 void Topic::setSubject(const QString &subject) 0091 { 0092 d->m_subject = subject; 0093 } 0094 0095 QString Topic::subject() const 0096 { 0097 return d->m_subject; 0098 } 0099 0100 void Topic::setContent(const QString &content) 0101 { 0102 d->m_content = content; 0103 } 0104 0105 QString Topic::content() const 0106 { 0107 return d->m_content; 0108 } 0109 0110 void Topic::setComments(const int comments) 0111 { 0112 d->m_comments = comments; 0113 } 0114 0115 int Topic::comments() const 0116 { 0117 return d->m_comments; 0118 } 0119 0120 bool Topic::isValid() const 0121 { 0122 return !(d->m_id.isEmpty()); 0123 }