KNewStuff
7#include "downloadlinkinfo.h"
9#include <QMimeDatabase>
19 bool isDownloadtypeLink =
true;
25DownloadLinkInfo::DownloadLinkInfo(
const KNSCore::Entry::DownloadLinkInformation &data)
26 : d(
new DownloadLinkInfoPrivate)
29 d->priceAmount = data.priceAmount;
30 d->distributionType = data.distributionType;
31 d->descriptionLink = data.descriptionLink;
33 d->isDownloadtypeLink = data.isDownloadtypeLink;
36 for (
QString string : data.tags) {
37 if (
string.startsWith(QStringLiteral(
"data##mimetype="))) {
38 d->mimeType =
string.split(QStringLiteral(
"=")).last();
42 if (d->icon.isEmpty()) {
45 if (d->icon.isEmpty()) {
46 d->icon = QStringLiteral(
"download");
52DownloadLinkInfo::~DownloadLinkInfo() =
default;
54QString DownloadLinkInfo::name()
const
59QString DownloadLinkInfo::priceAmount()
const
61 return d->priceAmount;
64QString DownloadLinkInfo::distributionType()
const
66 return d->distributionType;
69QString DownloadLinkInfo::descriptionLink()
const
71 return d->descriptionLink;
74int DownloadLinkInfo::id()
const
79bool DownloadLinkInfo::isDownloadtypeLink()
const
81 return d->isDownloadtypeLink;
84quint64 DownloadLinkInfo::size()
const
89QString DownloadLinkInfo::formattedSize()
const
95 return formatter.formatByteSize(d->size * 1000);
98QString DownloadLinkInfo::icon()
const
103#include "moc_downloadlinkinfo.cpp"
One downloadable item as contained within one content item.
QMimeType mimeTypeForName(const QString &nameOrAlias) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:52:28 by
doxygen 1.10.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.