File indexing completed on 2024-12-01 03:37:34
0001 /* 0002 This file is part of KDE. 0003 0004 SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0007 */ 0008 0009 #include "downloaditem.h" 0010 0011 using namespace Attica; 0012 0013 class Q_DECL_HIDDEN DownloadItem::Private : public QSharedData 0014 { 0015 public: 0016 QUrl m_url; 0017 QString m_mimeType; 0018 QString m_packageName; 0019 QString m_packageRepository; 0020 QString m_gpgFingerprint; 0021 QString m_gpgSignature; 0022 Attica::DownloadDescription::Type m_type; 0023 0024 Private() 0025 : m_type(DownloadDescription::FileDownload) 0026 { 0027 } 0028 }; 0029 0030 DownloadItem::DownloadItem() 0031 : d(new Private) 0032 { 0033 } 0034 0035 DownloadItem::DownloadItem(const Attica::DownloadItem &other) 0036 : d(other.d) 0037 { 0038 } 0039 0040 DownloadItem &DownloadItem::operator=(const Attica::DownloadItem &other) 0041 { 0042 d = other.d; 0043 return *this; 0044 } 0045 0046 DownloadItem::~DownloadItem() 0047 { 0048 } 0049 0050 void DownloadItem::setUrl(const QUrl &url) 0051 { 0052 d->m_url = url; 0053 } 0054 0055 QUrl DownloadItem::url() const 0056 { 0057 return d->m_url; 0058 } 0059 0060 void DownloadItem::setMimeType(const QString &mimeType) 0061 { 0062 d->m_mimeType = mimeType; 0063 } 0064 0065 QString DownloadItem::mimeType() const 0066 { 0067 return d->m_mimeType; 0068 } 0069 0070 void DownloadItem::setPackageName(const QString &packageName) 0071 { 0072 d->m_packageName = packageName; 0073 } 0074 0075 QString DownloadItem::packageName() const 0076 { 0077 return d->m_packageName; 0078 } 0079 0080 void DownloadItem::setPackageRepository(const QString &packageRepository) 0081 { 0082 d->m_packageRepository = packageRepository; 0083 } 0084 0085 QString DownloadItem::packageRepository() const 0086 { 0087 return d->m_packageRepository; 0088 } 0089 0090 void DownloadItem::setGpgFingerprint(const QString &gpgFingerprint) 0091 { 0092 d->m_gpgFingerprint = gpgFingerprint; 0093 } 0094 0095 QString DownloadItem::gpgFingerprint() const 0096 { 0097 return d->m_gpgFingerprint; 0098 } 0099 0100 void DownloadItem::setGpgSignature(const QString &gpgSignature) 0101 { 0102 d->m_gpgSignature = gpgSignature; 0103 } 0104 0105 QString DownloadItem::gpgSignature() const 0106 { 0107 return d->m_gpgSignature; 0108 } 0109 0110 void DownloadItem::setType(Attica::DownloadDescription::Type type) 0111 { 0112 d->m_type = type; 0113 } 0114 0115 Attica::DownloadDescription::Type DownloadItem::type() 0116 { 0117 return d->m_type; 0118 }