1 | /* |
---|---|
2 | This file is part of KDE. |
3 | |
4 | SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@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 "downloaddescription.h" |
10 | |
11 | #include <QStringList> |
12 | |
13 | namespace Attica |
14 | { |
15 | class Q_DECL_HIDDEN DownloadDescription::Private : public QSharedData |
16 | { |
17 | public: |
18 | int id = 0; |
19 | Attica::DownloadDescription::Type type = Attica::DownloadDescription::FileDownload; |
20 | bool hasPrice = false; |
21 | QString category; |
22 | QString name; |
23 | QString link; |
24 | QString distributionType; |
25 | QString priceReason; |
26 | QString priceAmount; |
27 | QString gpgFingerprint; |
28 | QString gpgSignature; |
29 | QString packageName; |
30 | QString repository; |
31 | uint size = 0; |
32 | QStringList tags; |
33 | QString version; |
34 | }; |
35 | } |
36 | |
37 | using namespace Attica; |
38 | |
39 | DownloadDescription::DownloadDescription() |
40 | : d(new Private) |
41 | { |
42 | } |
43 | |
44 | DownloadDescription::DownloadDescription(const Attica::DownloadDescription &other) |
45 | : d(other.d) |
46 | { |
47 | } |
48 | |
49 | DownloadDescription &DownloadDescription::operator=(const Attica::DownloadDescription &other) |
50 | { |
51 | d = other.d; |
52 | return *this; |
53 | } |
54 | |
55 | DownloadDescription::~DownloadDescription() |
56 | { |
57 | } |
58 | |
59 | QString Attica::DownloadDescription::category() const |
60 | { |
61 | return d->category; |
62 | } |
63 | |
64 | int DownloadDescription::id() const |
65 | { |
66 | return d->id; |
67 | } |
68 | |
69 | void DownloadDescription::setId(int id) |
70 | { |
71 | d->id = id; |
72 | } |
73 | |
74 | void DownloadDescription::setCategory(const QString &category) |
75 | { |
76 | d->category = category; |
77 | } |
78 | |
79 | QString Attica::DownloadDescription::distributionType() const |
80 | { |
81 | return d->distributionType; |
82 | } |
83 | |
84 | void DownloadDescription::setDistributionType(const QString &distributionType) |
85 | { |
86 | d->distributionType = distributionType; |
87 | } |
88 | |
89 | bool Attica::DownloadDescription::hasPrice() const |
90 | { |
91 | return d->hasPrice; |
92 | } |
93 | |
94 | void DownloadDescription::setHasPrice(bool hasPrice) |
95 | { |
96 | d->hasPrice = hasPrice; |
97 | } |
98 | |
99 | Attica::DownloadDescription::Type DownloadDescription::type() const |
100 | { |
101 | return d->type; |
102 | } |
103 | |
104 | void DownloadDescription::setType(Attica::DownloadDescription::Type type) |
105 | { |
106 | d->type = type; |
107 | } |
108 | |
109 | QString Attica::DownloadDescription::link() const |
110 | { |
111 | return d->link; |
112 | } |
113 | |
114 | void DownloadDescription::setLink(const QString &link) |
115 | { |
116 | d->link = link; |
117 | } |
118 | |
119 | QString Attica::DownloadDescription::name() const |
120 | { |
121 | return d->name; |
122 | } |
123 | |
124 | void DownloadDescription::setName(const QString &name) |
125 | { |
126 | d->name = name; |
127 | } |
128 | |
129 | QString Attica::DownloadDescription::priceAmount() const |
130 | { |
131 | return d->priceAmount; |
132 | } |
133 | |
134 | void DownloadDescription::setPriceAmount(const QString &priceAmount) |
135 | { |
136 | d->priceAmount = priceAmount; |
137 | } |
138 | |
139 | QString Attica::DownloadDescription::priceReason() const |
140 | { |
141 | return d->priceReason; |
142 | } |
143 | |
144 | void Attica::DownloadDescription::setPriceReason(const QString &priceReason) |
145 | { |
146 | d->priceReason = priceReason; |
147 | } |
148 | |
149 | uint Attica::DownloadDescription::size() const |
150 | { |
151 | return d->size; |
152 | } |
153 | |
154 | void Attica::DownloadDescription::setSize(uint size) |
155 | { |
156 | d->size = size; |
157 | } |
158 | |
159 | QString Attica::DownloadDescription::gpgFingerprint() const |
160 | { |
161 | return d->gpgFingerprint; |
162 | } |
163 | |
164 | void Attica::DownloadDescription::setGpgFingerprint(const QString &fingerprint) |
165 | { |
166 | d->gpgFingerprint = fingerprint; |
167 | } |
168 | |
169 | QString Attica::DownloadDescription::gpgSignature() const |
170 | { |
171 | return d->gpgSignature; |
172 | } |
173 | |
174 | void Attica::DownloadDescription::setGpgSignature(const QString &signature) |
175 | { |
176 | d->gpgSignature = signature; |
177 | } |
178 | |
179 | QString Attica::DownloadDescription::packageName() const |
180 | { |
181 | return d->packageName; |
182 | } |
183 | |
184 | void Attica::DownloadDescription::setPackageName(const QString &packageName) |
185 | { |
186 | d->packageName = packageName; |
187 | } |
188 | |
189 | QString Attica::DownloadDescription::repository() const |
190 | { |
191 | return d->repository; |
192 | } |
193 | |
194 | void Attica::DownloadDescription::setRepository(const QString &repository) |
195 | { |
196 | d->repository = repository; |
197 | } |
198 | |
199 | QStringList Attica::DownloadDescription::tags() const |
200 | { |
201 | return d->tags; |
202 | } |
203 | |
204 | void Attica::DownloadDescription::setTags(const QStringList &tags) |
205 | { |
206 | d->tags = tags; |
207 | } |
208 | |
209 | QString Attica::DownloadDescription::version() const |
210 | { |
211 | return d->version; |
212 | } |
213 | |
214 | void Attica::DownloadDescription::setVersion(const QString &version) |
215 | { |
216 | d->version = version; |
217 | } |
218 |