File indexing completed on 2024-07-07 14:12:28

0001 /*
0002     This file is part of KDE.
0003 
0004     SPDX-FileCopyrightText: 2008 Cornelius Schumacher <schumacher@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #include "activity.h"
0010 
0011 #include <QDateTime>
0012 
0013 using namespace Attica;
0014 
0015 class Q_DECL_HIDDEN Activity::Private : public QSharedData
0016 {
0017 public:
0018     QString m_id;
0019     Person m_associatedPerson;
0020     QDateTime m_timestamp;
0021     QString m_message;
0022     QUrl m_link;
0023 };
0024 
0025 Activity::Activity()
0026     : d(new Private)
0027 {
0028 }
0029 
0030 Activity::Activity(const Attica::Activity &other)
0031     : d(other.d)
0032 {
0033 }
0034 
0035 Activity &Activity::operator=(const Attica::Activity &other)
0036 {
0037     d = other.d;
0038     return *this;
0039 }
0040 
0041 Activity::~Activity()
0042 {
0043 }
0044 
0045 void Activity::setId(const QString &id)
0046 {
0047     d->m_id = id;
0048 }
0049 
0050 QString Activity::id() const
0051 {
0052     return d->m_id;
0053 }
0054 
0055 void Activity::setAssociatedPerson(const Person &associatedPerson)
0056 {
0057     d->m_associatedPerson = associatedPerson;
0058 }
0059 
0060 Person Activity::associatedPerson() const
0061 {
0062     return d->m_associatedPerson;
0063 }
0064 
0065 void Activity::setTimestamp(const QDateTime &date)
0066 {
0067     d->m_timestamp = date;
0068 }
0069 
0070 QDateTime Activity::timestamp() const
0071 {
0072     return d->m_timestamp;
0073 }
0074 
0075 void Activity::setMessage(const QString &c)
0076 {
0077     d->m_message = c;
0078 }
0079 
0080 QString Activity::message() const
0081 {
0082     return d->m_message;
0083 }
0084 
0085 void Activity::setLink(const QUrl &v)
0086 {
0087     d->m_link = v;
0088 }
0089 
0090 QUrl Activity::link() const
0091 {
0092     return d->m_link;
0093 }
0094 
0095 bool Activity::isValid() const
0096 {
0097     return !(d->m_id.isEmpty());
0098 }