Attica

category.cpp
1 /*
2  This file is part of KDE.
3 
4  SPDX-FileCopyrightText: 2008 Cornelius Schumacher <[email protected]>
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 
25  : d(new Private)
26 {
27 }
28 
30  : d(other.d)
31 {
32 }
33 
35 {
36  d = other.d;
37  return *this;
38 }
39 
41 {
42 }
43 
44 void Category::setId(const QString &u)
45 {
46  d->m_id = u;
47 }
48 
50 {
51  return d->m_id;
52 }
53 
54 void Category::setName(const QString &name)
55 {
56  d->m_name = name;
57 }
58 
60 {
61  return d->m_name;
62 }
63 
65 {
66  d->m_displayName = name;
67 }
68 
70 {
71  return d->m_displayName;
72 }
73 
74 bool Category::isValid() const
75 {
76  return !(d->m_id.isEmpty());
77 }
QString name() const
Gets the name of the Category.
Definition: category.cpp:59
Category & operator=(const Category &other)
Assignment operator.
Definition: category.cpp:34
bool isValid() const
Checks whether this Category has an id.
Definition: category.cpp:74
Category()
Creates an empty Category.
Definition: category.cpp:24
void setName(const QString &name)
Sets the name of the Category.
Definition: category.cpp:54
void setDisplayName(const QString &name)
Sets the display name of the Category.
Definition: category.cpp:64
~Category()
Destructor.
Definition: category.cpp:40
The Attica namespace,.
QString displayName() const
Gets the display name of the Category.
Definition: category.cpp:69
void setId(const QString &)
Sets the id of the Category.
Definition: category.cpp:44
QString id() const
Gets the id of the Category.
Definition: category.cpp:49
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Dec 11 2023 04:05:13 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.