Warning, file /frameworks/knewstuff/src/entry.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.1-or-later 0005 */ 0006 0007 #include "entry.h" 0008 #include "entry_p.h" 0009 #include <knewstuff_debug.h> 0010 0011 using namespace KNS3; 0012 0013 Entry::Entry() 0014 : d(new EntryPrivate) 0015 { 0016 } 0017 0018 Entry::Entry(const Entry &other) 0019 : d(other.d) 0020 { 0021 } 0022 0023 Entry &Entry::operator=(const Entry &other) 0024 { 0025 d = other.d; 0026 return *this; 0027 } 0028 0029 Entry::~Entry() 0030 { 0031 } 0032 0033 QString Entry::id() const 0034 { 0035 return d->e.uniqueId(); 0036 } 0037 0038 QString Entry::providerId() const 0039 { 0040 return d->e.providerId(); 0041 } 0042 0043 QString Entry::name() const 0044 { 0045 return d->e.name(); 0046 } 0047 0048 QString Entry::category() const 0049 { 0050 return d->e.category(); 0051 } 0052 0053 QString Entry::license() const 0054 { 0055 return d->e.license(); 0056 } 0057 0058 QString Entry::summary() const 0059 { 0060 return d->e.summary(); 0061 } 0062 0063 QString Entry::version() const 0064 { 0065 return d->e.version(); 0066 } 0067 0068 Entry::Status Entry::status() const 0069 { 0070 return static_cast<Entry::Status>(d->e.status()); 0071 } 0072 0073 QStringList KNS3::Entry::installedFiles() const 0074 { 0075 return d->e.installedFiles(); 0076 } 0077 0078 QStringList KNS3::Entry::uninstalledFiles() const 0079 { 0080 return d->e.uninstalledFiles(); 0081 } 0082 0083 QUrl KNS3::Entry::url() const 0084 { 0085 return d->e.homepage(); 0086 } 0087 0088 static void appendIfValid(QList<QUrl> &list, const QUrl &value) 0089 { 0090 if (value.isValid() && !value.isEmpty()) { 0091 list << value; 0092 } 0093 } 0094 0095 QList<QUrl> KNS3::Entry::previewImages() const 0096 { 0097 QList<QUrl> ret; 0098 appendIfValid(ret, QUrl(d->e.previewUrl(KNSCore::EntryInternal::PreviewBig1))); 0099 appendIfValid(ret, QUrl(d->e.previewUrl(KNSCore::EntryInternal::PreviewBig2))); 0100 appendIfValid(ret, QUrl(d->e.previewUrl(KNSCore::EntryInternal::PreviewBig3))); 0101 return ret; 0102 } 0103 0104 QList<QUrl> KNS3::Entry::previewThumbnails() const 0105 { 0106 QList<QUrl> ret; 0107 appendIfValid(ret, QUrl(d->e.previewUrl(KNSCore::EntryInternal::PreviewSmall1))); 0108 appendIfValid(ret, QUrl(d->e.previewUrl(KNSCore::EntryInternal::PreviewSmall2))); 0109 appendIfValid(ret, QUrl(d->e.previewUrl(KNSCore::EntryInternal::PreviewSmall3))); 0110 return ret; 0111 } 0112 0113 quint64 KNS3::Entry::size() const 0114 { 0115 const auto downloadInfo = d->e.downloadLinkInformationList(); 0116 return downloadInfo.isEmpty() ? 0 : downloadInfo.at(0).size; 0117 } 0118 0119 uint KNS3::Entry::numberOfComments() const 0120 { 0121 return d->e.numberOfComments(); 0122 } 0123 0124 uint KNS3::Entry::rating() const 0125 { 0126 return d->e.rating(); 0127 } 0128 0129 QString KNS3::Entry::updateVersion() const 0130 { 0131 return d->e.updateVersion(); 0132 } 0133 0134 QString KNS3::Entry::changelog() const 0135 { 0136 return d->e.changelog(); 0137 } 0138 0139 QString KNS3::Entry::shortSummary() const 0140 { 0141 return d->e.shortSummary(); 0142 }