KNewStuff

downloadlinkinfo.cpp
1 /*
2  SPDX-FileCopyrightText: 2016 Dan Leinir Turthra Jensen <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #include "downloadlinkinfo.h"
8 
9 class DownloadLinkInfo::Private
10 {
11 public:
12  Private()
13  : id(0)
14  , isDownloadtypeLink(true)
15  , size(0)
16  {}
17 
18  QString name;
19  QString priceAmount;
20  QString distributionType;
21  QString descriptionLink;
22  int id;
23  bool isDownloadtypeLink;
24  quint64 size;
25 };
26 
27 DownloadLinkInfo::DownloadLinkInfo(QObject* parent)
28  : QObject(parent)
29  , d(new Private)
30 {
31 }
32 
33 DownloadLinkInfo::~DownloadLinkInfo()
34 {
35  delete d;
36 }
37 
38 void DownloadLinkInfo::setData(const KNSCore::EntryInternal::DownloadLinkInformation& data)
39 {
40  d->name = data.name;
41  d->priceAmount = data.priceAmount;
42  d->distributionType = data.distributionType;
43  d->descriptionLink = data.descriptionLink;
44  d->id = data.id;
45  d->isDownloadtypeLink = data.isDownloadtypeLink;
46  d->size = data.size;
47  Q_EMIT dataChanged();
48 }
49 
50 QString DownloadLinkInfo::name() const
51 {
52  return d->name;
53 }
54 
55 QString DownloadLinkInfo::priceAmount() const
56 {
57  return d->priceAmount;
58 }
59 
60 QString DownloadLinkInfo::distributionType() const
61 {
62  return d->distributionType;
63 }
64 
65 QString DownloadLinkInfo::descriptionLink() const
66 {
67  return d->descriptionLink;
68 }
69 
70 int DownloadLinkInfo::id() const
71 {
72  return d->id;
73 }
74 
75 bool DownloadLinkInfo::isDownloadtypeLink() const
76 {
77  return d->isDownloadtypeLink;
78 }
79 
80 quint64 DownloadLinkInfo::size() const
81 {
82  return d->size;
83 }
QString name(const QVariant &location)
QObject * parent() const const
Q_EMITQ_EMIT
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 18 2021 22:43:49 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.