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 "downloaditem.h" |
10 | |
11 | using namespace Attica; |
12 | |
13 | class Q_DECL_HIDDEN DownloadItem::Private : public QSharedData |
14 | { |
15 | public: |
16 | QUrl m_url; |
17 | QString m_mimeType; |
18 | QString m_packageName; |
19 | QString m_packageRepository; |
20 | QString m_gpgFingerprint; |
21 | QString m_gpgSignature; |
22 | Attica::DownloadDescription::Type m_type; |
23 | |
24 | Private() |
25 | : m_type(DownloadDescription::FileDownload) |
26 | { |
27 | } |
28 | }; |
29 | |
30 | DownloadItem::DownloadItem() |
31 | : d(new Private) |
32 | { |
33 | } |
34 | |
35 | DownloadItem::DownloadItem(const Attica::DownloadItem &other) |
36 | : d(other.d) |
37 | { |
38 | } |
39 | |
40 | DownloadItem &DownloadItem::operator=(const Attica::DownloadItem &other) |
41 | { |
42 | d = other.d; |
43 | return *this; |
44 | } |
45 | |
46 | DownloadItem::~DownloadItem() |
47 | { |
48 | } |
49 | |
50 | void DownloadItem::setUrl(const QUrl &url) |
51 | { |
52 | d->m_url = url; |
53 | } |
54 | |
55 | QUrl DownloadItem::url() const |
56 | { |
57 | return d->m_url; |
58 | } |
59 | |
60 | void DownloadItem::setMimeType(const QString &mimeType) |
61 | { |
62 | d->m_mimeType = mimeType; |
63 | } |
64 | |
65 | QString DownloadItem::mimeType() const |
66 | { |
67 | return d->m_mimeType; |
68 | } |
69 | |
70 | void DownloadItem::setPackageName(const QString &packageName) |
71 | { |
72 | d->m_packageName = packageName; |
73 | } |
74 | |
75 | QString DownloadItem::packageName() const |
76 | { |
77 | return d->m_packageName; |
78 | } |
79 | |
80 | void DownloadItem::setPackageRepository(const QString &packageRepository) |
81 | { |
82 | d->m_packageRepository = packageRepository; |
83 | } |
84 | |
85 | QString DownloadItem::packageRepository() const |
86 | { |
87 | return d->m_packageRepository; |
88 | } |
89 | |
90 | void DownloadItem::setGpgFingerprint(const QString &gpgFingerprint) |
91 | { |
92 | d->m_gpgFingerprint = gpgFingerprint; |
93 | } |
94 | |
95 | QString DownloadItem::gpgFingerprint() const |
96 | { |
97 | return d->m_gpgFingerprint; |
98 | } |
99 | |
100 | void DownloadItem::setGpgSignature(const QString &gpgSignature) |
101 | { |
102 | d->m_gpgSignature = gpgSignature; |
103 | } |
104 | |
105 | QString DownloadItem::gpgSignature() const |
106 | { |
107 | return d->m_gpgSignature; |
108 | } |
109 | |
110 | void DownloadItem::setType(Attica::DownloadDescription::Type type) |
111 | { |
112 | d->m_type = type; |
113 | } |
114 | |
115 | Attica::DownloadDescription::Type DownloadItem::type() |
116 | { |
117 | return d->m_type; |
118 | } |
119 |