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 | }; |
34 | } |
35 | |
36 | using namespace Attica; |
37 | |
38 | DownloadDescription::DownloadDescription() |
39 | : d(new Private) |
40 | { |
41 | } |
42 | |
43 | DownloadDescription::DownloadDescription(const Attica::DownloadDescription &other) |
44 | : d(other.d) |
45 | { |
46 | } |
47 | |
48 | DownloadDescription &DownloadDescription::operator=(const Attica::DownloadDescription &other) |
49 | { |
50 | d = other.d; |
51 | return *this; |
52 | } |
53 | |
54 | DownloadDescription::~DownloadDescription() |
55 | { |
56 | } |
57 | |
58 | QString Attica::DownloadDescription::category() const |
59 | { |
60 | return d->category; |
61 | } |
62 | |
63 | int DownloadDescription::id() const |
64 | { |
65 | return d->id; |
66 | } |
67 | |
68 | void DownloadDescription::setId(int id) |
69 | { |
70 | d->id = id; |
71 | } |
72 | |
73 | void DownloadDescription::setCategory(const QString &category) |
74 | { |
75 | d->category = category; |
76 | } |
77 | |
78 | QString Attica::DownloadDescription::distributionType() const |
79 | { |
80 | return d->distributionType; |
81 | } |
82 | |
83 | void DownloadDescription::setDistributionType(const QString &distributionType) |
84 | { |
85 | d->distributionType = distributionType; |
86 | } |
87 | |
88 | bool Attica::DownloadDescription::hasPrice() const |
89 | { |
90 | return d->hasPrice; |
91 | } |
92 | |
93 | void DownloadDescription::setHasPrice(bool hasPrice) |
94 | { |
95 | d->hasPrice = hasPrice; |
96 | } |
97 | |
98 | Attica::DownloadDescription::Type DownloadDescription::type() const |
99 | { |
100 | return d->type; |
101 | } |
102 | |
103 | void DownloadDescription::setType(Attica::DownloadDescription::Type type) |
104 | { |
105 | d->type = type; |
106 | } |
107 | |
108 | QString Attica::DownloadDescription::link() const |
109 | { |
110 | return d->link; |
111 | } |
112 | |
113 | void DownloadDescription::setLink(const QString &link) |
114 | { |
115 | d->link = link; |
116 | } |
117 | |
118 | QString Attica::DownloadDescription::name() const |
119 | { |
120 | return d->name; |
121 | } |
122 | |
123 | void DownloadDescription::setName(const QString &name) |
124 | { |
125 | d->name = name; |
126 | } |
127 | |
128 | QString Attica::DownloadDescription::priceAmount() const |
129 | { |
130 | return d->priceAmount; |
131 | } |
132 | |
133 | void DownloadDescription::setPriceAmount(const QString &priceAmount) |
134 | { |
135 | d->priceAmount = priceAmount; |
136 | } |
137 | |
138 | QString Attica::DownloadDescription::priceReason() const |
139 | { |
140 | return d->priceReason; |
141 | } |
142 | |
143 | void Attica::DownloadDescription::setPriceReason(const QString &priceReason) |
144 | { |
145 | d->priceReason = priceReason; |
146 | } |
147 | |
148 | uint Attica::DownloadDescription::size() const |
149 | { |
150 | return d->size; |
151 | } |
152 | |
153 | void Attica::DownloadDescription::setSize(uint size) |
154 | { |
155 | d->size = size; |
156 | } |
157 | |
158 | QString Attica::DownloadDescription::gpgFingerprint() const |
159 | { |
160 | return d->gpgFingerprint; |
161 | } |
162 | |
163 | void Attica::DownloadDescription::setGpgFingerprint(const QString &fingerprint) |
164 | { |
165 | d->gpgFingerprint = fingerprint; |
166 | } |
167 | |
168 | QString Attica::DownloadDescription::gpgSignature() const |
169 | { |
170 | return d->gpgSignature; |
171 | } |
172 | |
173 | void Attica::DownloadDescription::setGpgSignature(const QString &signature) |
174 | { |
175 | d->gpgSignature = signature; |
176 | } |
177 | |
178 | QString Attica::DownloadDescription::packageName() const |
179 | { |
180 | return d->packageName; |
181 | } |
182 | |
183 | void Attica::DownloadDescription::setPackageName(const QString &packageName) |
184 | { |
185 | d->packageName = packageName; |
186 | } |
187 | |
188 | QString Attica::DownloadDescription::repository() const |
189 | { |
190 | return d->repository; |
191 | } |
192 | |
193 | void Attica::DownloadDescription::setRepository(const QString &repository) |
194 | { |
195 | d->repository = repository; |
196 | } |
197 | |
198 | QStringList Attica::DownloadDescription::tags() const |
199 | { |
200 | return d->tags; |
201 | } |
202 | |
203 | void Attica::DownloadDescription::setTags(const QStringList &tags) |
204 | { |
205 | d->tags = tags; |
206 | } |
207 |