File indexing completed on 2024-12-01 03:37:37

0001 /*
0002     This file is part of KDE.
0003 
0004     SPDX-FileCopyrightText: 2010 Sebastian Kügler <sebas@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 "publisher.h"
0010 
0011 using namespace Attica;
0012 
0013 class Q_DECL_HIDDEN Publisher::Private : public QSharedData
0014 {
0015 public:
0016     QString id;
0017     QString name;
0018     QString url;
0019     QList<Field> fields;
0020     QList<Target> targets;
0021 
0022     Private()
0023     {
0024     }
0025 };
0026 
0027 Publisher::Publisher()
0028     : d(new Private)
0029 {
0030 }
0031 
0032 Publisher::Publisher(const Publisher &other)
0033     : d(other.d)
0034 {
0035 }
0036 
0037 Publisher &Publisher::operator=(const Attica::Publisher &other)
0038 {
0039     d = other.d;
0040     return *this;
0041 }
0042 
0043 Publisher::~Publisher()
0044 {
0045 }
0046 
0047 void Publisher::setId(const QString &u)
0048 {
0049     d->id = u;
0050 }
0051 
0052 QString Publisher::id() const
0053 {
0054     return d->id;
0055 }
0056 
0057 void Publisher::setName(const QString &u)
0058 {
0059     d->name = u;
0060 }
0061 
0062 QString Publisher::name() const
0063 {
0064     return d->name;
0065 }
0066 
0067 void Publisher::addField(const Field &t)
0068 {
0069     d->fields << t;
0070 }
0071 
0072 QList<Field> Publisher::fields() const
0073 {
0074     return d->fields;
0075 }
0076 
0077 void Publisher::setUrl(const QString &u)
0078 {
0079     d->url = u;
0080 }
0081 
0082 QString Publisher::url() const
0083 {
0084     return d->url;
0085 }
0086 
0087 void Publisher::addTarget(const Attica::Target &t)
0088 {
0089     d->targets << t;
0090 }
0091 
0092 QList<Target> Publisher::targets() const
0093 {
0094     return d->targets;
0095 }
0096 
0097 bool Publisher::isValid() const
0098 {
0099     return !(d->id.isEmpty());
0100 }