1 | /* |
2 | This file is part of KDE. |
3 | |
4 | SPDX-FileCopyrightText: 2010 Sebastian Kügler <sebas@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 "project.h" |
10 | |
11 | using namespace Attica; |
12 | |
13 | class Q_DECL_HIDDEN Project::Private : public QSharedData |
14 | { |
15 | public: |
16 | QString m_id; |
17 | QString m_name; |
18 | QString m_version; |
19 | QString m_license; |
20 | QString m_url; |
21 | QString m_summary; |
22 | QString m_description; |
23 | QStringList m_developers; |
24 | QString m_requirements; |
25 | QString m_specFile; |
26 | |
27 | QMap<QString, QString> m_extendedAttributes; |
28 | |
29 | Private() |
30 | { |
31 | } |
32 | }; |
33 | |
34 | Project::Project() |
35 | : d(new Private) |
36 | { |
37 | } |
38 | |
39 | Project::Project(const Project &other) |
40 | : d(other.d) |
41 | { |
42 | } |
43 | |
44 | Project &Project::operator=(const Attica::Project &other) |
45 | { |
46 | d = other.d; |
47 | return *this; |
48 | } |
49 | |
50 | Project::~Project() |
51 | { |
52 | } |
53 | |
54 | void Project::setId(const QString &u) |
55 | { |
56 | d->m_id = u; |
57 | } |
58 | |
59 | QString Project::id() const |
60 | { |
61 | return d->m_id; |
62 | } |
63 | |
64 | void Project::setName(const QString &name) |
65 | { |
66 | d->m_name = name; |
67 | } |
68 | |
69 | QString Project::name() const |
70 | { |
71 | return d->m_name; |
72 | } |
73 | |
74 | void Project::setVersion(const QString &name) |
75 | { |
76 | d->m_version = name; |
77 | } |
78 | |
79 | QString Project::version() const |
80 | { |
81 | return d->m_version; |
82 | } |
83 | |
84 | void Project::setLicense(const QString &name) |
85 | { |
86 | d->m_license = name; |
87 | } |
88 | |
89 | QString Project::license() const |
90 | { |
91 | return d->m_license; |
92 | } |
93 | |
94 | void Project::setUrl(const QString &name) |
95 | { |
96 | d->m_url = name; |
97 | } |
98 | |
99 | QString Project::url() const |
100 | { |
101 | return d->m_url; |
102 | } |
103 | |
104 | void Project::setSummary(const QString &name) |
105 | { |
106 | d->m_summary = name; |
107 | } |
108 | |
109 | QString Project::summary() const |
110 | { |
111 | return d->m_summary; |
112 | } |
113 | |
114 | void Project::setDescription(const QString &name) |
115 | { |
116 | d->m_description = name; |
117 | } |
118 | |
119 | QString Project::description() const |
120 | { |
121 | return d->m_description; |
122 | } |
123 | |
124 | void Project::setDevelopers(const QStringList &name) |
125 | { |
126 | d->m_developers = name; |
127 | } |
128 | |
129 | QStringList Project::developers() const |
130 | { |
131 | return d->m_developers; |
132 | } |
133 | |
134 | void Project::setRequirements(const QString &name) |
135 | { |
136 | d->m_requirements = name; |
137 | } |
138 | |
139 | QString Project::requirements() const |
140 | { |
141 | return d->m_requirements; |
142 | } |
143 | |
144 | void Project::setSpecFile(const QString &name) |
145 | { |
146 | d->m_specFile = name; |
147 | } |
148 | |
149 | QString Project::specFile() const |
150 | { |
151 | return d->m_specFile; |
152 | } |
153 | |
154 | void Project::addExtendedAttribute(const QString &key, const QString &value) |
155 | { |
156 | d->m_extendedAttributes.insert(key, value); |
157 | } |
158 | |
159 | QString Project::extendedAttribute(const QString &key) const |
160 | { |
161 | return d->m_extendedAttributes.value(key); |
162 | } |
163 | |
164 | QMap<QString, QString> Project::extendedAttributes() const |
165 | { |
166 | return d->m_extendedAttributes; |
167 | } |
168 | |
169 | bool Project::isValid() const |
170 | { |
171 | return !(d->m_id.isEmpty()); |
172 | } |
173 | |