File indexing completed on 2024-09-15 06:28:14
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 "category.h" 0010 0011 #include <QDebug> 0012 #include <QString> 0013 0014 using namespace Attica; 0015 0016 class Q_DECL_HIDDEN Category::Private : public QSharedData 0017 { 0018 public: 0019 QString m_id; 0020 QString m_name; 0021 QString m_displayName; 0022 }; 0023 0024 Category::Category() 0025 : d(new Private) 0026 { 0027 } 0028 0029 Category::Category(const Attica::Category &other) 0030 : d(other.d) 0031 { 0032 } 0033 0034 Category &Category::operator=(const Attica::Category &other) 0035 { 0036 d = other.d; 0037 return *this; 0038 } 0039 0040 Category::~Category() 0041 { 0042 } 0043 0044 void Category::setId(const QString &u) 0045 { 0046 d->m_id = u; 0047 } 0048 0049 QString Category::id() const 0050 { 0051 return d->m_id; 0052 } 0053 0054 void Category::setName(const QString &name) 0055 { 0056 d->m_name = name; 0057 } 0058 0059 QString Category::name() const 0060 { 0061 return d->m_name; 0062 } 0063 0064 void Category::setDisplayName(const QString &name) 0065 { 0066 d->m_displayName = name; 0067 } 0068 0069 QString Category::displayName() const 0070 { 0071 return d->m_displayName; 0072 } 0073 0074 bool Category::isValid() const 0075 { 0076 return !(d->m_id.isEmpty()); 0077 }