| 1 | /* |
| 2 | This file is part of KDE. |
| 3 | |
| 4 | SPDX-FileCopyrightText: 2008 Cornelius Schumacher <schumacher@kde.org> |
| 5 | |
| 6 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 7 | */ |
| 8 | |
| 9 | #include "category.h" |
| 10 | |
| 11 | #include <QDebug> |
| 12 | #include <QString> |
| 13 | |
| 14 | using namespace Attica; |
| 15 | |
| 16 | class Q_DECL_HIDDEN Category::Private : public QSharedData |
| 17 | { |
| 18 | public: |
| 19 | QString m_id; |
| 20 | QString m_name; |
| 21 | QString m_displayName; |
| 22 | }; |
| 23 | |
| 24 | Category::Category() |
| 25 | : d(new Private) |
| 26 | { |
| 27 | } |
| 28 | |
| 29 | Category::Category(const Attica::Category &other) |
| 30 | : d(other.d) |
| 31 | { |
| 32 | } |
| 33 | |
| 34 | Category &Category::operator=(const Attica::Category &other) |
| 35 | { |
| 36 | d = other.d; |
| 37 | return *this; |
| 38 | } |
| 39 | |
| 40 | Category::~Category() |
| 41 | { |
| 42 | } |
| 43 | |
| 44 | void Category::setId(const QString &u) |
| 45 | { |
| 46 | d->m_id = u; |
| 47 | } |
| 48 | |
| 49 | QString Category::id() const |
| 50 | { |
| 51 | return d->m_id; |
| 52 | } |
| 53 | |
| 54 | void Category::setName(const QString &name) |
| 55 | { |
| 56 | d->m_name = name; |
| 57 | } |
| 58 | |
| 59 | QString Category::name() const |
| 60 | { |
| 61 | return d->m_name; |
| 62 | } |
| 63 | |
| 64 | void Category::setDisplayName(const QString &name) |
| 65 | { |
| 66 | d->m_displayName = name; |
| 67 | } |
| 68 | |
| 69 | QString Category::displayName() const |
| 70 | { |
| 71 | return d->m_displayName; |
| 72 | } |
| 73 | |
| 74 | bool Category::isValid() const |
| 75 | { |
| 76 | return !(d->m_id.isEmpty()); |
| 77 | } |
| 78 | |