• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KNewStuff

  • knewstuff
  • knewstuff2
  • core
knewstuff2/core/entry.cpp
Go to the documentation of this file.
1/*
2 This file is part of KNewStuff2.
3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
4 Copyright (c) 2003 - 2007 Josef Spillner <spillner@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#include "entry.h"
21
22using namespace KNS;
23
24struct KNS::EntryPrivate {
25 EntryPrivate() : mReleaseDate(QDate::currentDate())
26 , mRelease(0)
27 , mRating(0)
28 , mDownloads(0)
29 , mIdNumber(0)
30 , mStatus(Entry::Invalid)
31 , mSource(Entry::Online) {}
32
33 QString mCategory;
34 QString mLicense;
35 QString mVersion;
36 QDate mReleaseDate;
37 Author mAuthor;
38 int mRelease;
39 int mRating;
40 int mDownloads;
41 KTranslatable mName;
42 KTranslatable mSummary;
43 KTranslatable mPayload;
44 KTranslatable mPreview;
45 QStringList mInstalledFiles;
46 int mIdNumber;
47 QStringList mUnInstalledFiles;
48
49 QString mChecksum;
50 QString mSignature;
51 Entry::Status mStatus;
52 Entry::Source mSource;
53};
54
55Entry::Entry()
56 : d(new EntryPrivate)
57{
58}
59
60Entry::Entry(const Entry& other)
61 : d(new EntryPrivate(*other.d))
62{
63}
64
65Entry& Entry::operator=(const Entry & other)
66{
67 *d = *other.d;
68 return *this;
69}
70
71Entry::~Entry()
72{
73 delete d;
74}
75
76void Entry::setName(const KTranslatable& name)
77{
78 d->mName = name;
79}
80
81KTranslatable Entry::name() const
82{
83 return d->mName;
84}
85
86void Entry::setCategory(const QString& category)
87{
88 d->mCategory = category;
89}
90
91QString Entry::category() const
92{
93 return d->mCategory;
94}
95
96void Entry::setAuthor(const Author &author)
97{
98 d->mAuthor = author;
99}
100
101Author Entry::author() const
102{
103 return d->mAuthor;
104}
105
106void Entry::setLicense(const QString &license)
107{
108 d->mLicense = license;
109}
110
111QString Entry::license() const
112{
113 return d->mLicense;
114}
115
116void Entry::setSummary(const KTranslatable &text)
117{
118 d->mSummary = text;
119}
120
121KTranslatable Entry::summary() const
122{
123 return d->mSummary;
124}
125
126void Entry::setVersion(const QString& version)
127{
128 d->mVersion = version;
129}
130
131QString Entry::version() const
132{
133 return d->mVersion;
134}
135
136void Entry::setRelease(int release)
137{
138 d->mRelease = release;
139}
140
141int Entry::release() const
142{
143 return d->mRelease;
144}
145
146void Entry::setReleaseDate(const QDate& date)
147{
148 d->mReleaseDate = date;
149}
150
151QDate Entry::releaseDate() const
152{
153 return d->mReleaseDate;
154}
155
156void Entry::setPayload(const KTranslatable& url)
157{
158 d->mPayload = url;
159}
160
161KTranslatable Entry::payload() const
162{
163 return d->mPayload;
164}
165
166void Entry::setPreview(const KTranslatable& url)
167{
168 d->mPreview = url;
169}
170
171KTranslatable Entry::preview() const
172{
173 return d->mPreview;
174}
175
176void Entry::setRating(int rating)
177{
178 d->mRating = rating;
179}
180
181int Entry::rating() const
182{
183 return d->mRating;
184}
185
186void Entry::setDownloads(int downloads)
187{
188 d->mDownloads = downloads;
189}
190
191int Entry::downloads() const
192{
193 return d->mDownloads;
194}
195
196void Entry::setChecksum(const QString& checksum)
197{
198 d->mChecksum = checksum;
199}
200
201QString Entry::checksum() const
202{
203 return d->mChecksum;
204}
205
206void Entry::setSignature(const QString& signature)
207{
208 d->mSignature = signature;
209}
210
211QString Entry::signature() const
212{
213 return d->mSignature;
214}
215
216Entry::Status Entry::status()
217{
218 return d->mStatus;
219}
220
221void Entry::setStatus(Status status)
222{
223 d->mStatus = status;
224}
225
226Entry::Source Entry::source()
227{
228 return d->mSource;
229}
230
231void Entry::setSource(Source source)
232{
233 d->mSource = source;
234}
235
236void KNS::Entry::setInstalledFiles(const QStringList & files)
237{
238 d->mInstalledFiles = files;
239}
240
241QStringList KNS::Entry::installedFiles() const
242{
243 return d->mInstalledFiles;
244}
245
246void Entry::setIdNumber(int number)
247{
248 d->mIdNumber = number;
249}
250
251int Entry::idNumber() const
252{
253 return d->mIdNumber;
254}
255
256void KNS::Entry::setUnInstalledFiles(const QStringList & files)
257{
258 d->mUnInstalledFiles = files;
259}
260
261QStringList KNS::Entry::uninstalledFiles() const
262{
263 return d->mUnInstalledFiles;
264}
265
KNS::Author
KNewStuff author information.
Definition knewstuff2/core/author.h:41
KNS::Entry::source
Source source()
Definition knewstuff2/core/entry.cpp:226
KNS::Entry::setRating
void setRating(int rating)
Sets the rating between 0 (worst) and 100 (best).
Definition knewstuff2/core/entry.cpp:176
KNS::Entry::setLicense
void setLicense(const QString &license)
Sets the license (abbreviation) applicable to the object.
Definition knewstuff2/core/entry.cpp:106
KNS::Entry::setInstalledFiles
void setInstalledFiles(const QStringList &files)
Set the files that have been installed by the install command.
Definition knewstuff2/core/entry.cpp:236
KNS::Entry::preview
KTranslatable preview() const
Retrieve the file name of an image containing a preview of the object.
Definition knewstuff2/core/entry.cpp:171
KNS::Entry::releaseDate
QDate releaseDate() const
Retrieve the date of the object's publication.
Definition knewstuff2/core/entry.cpp:151
KNS::Entry::uninstalledFiles
QStringList uninstalledFiles() const
Retrieve the locally uninstalled files.
Definition knewstuff2/core/entry.cpp:261
KNS::Entry::setUnInstalledFiles
void setUnInstalledFiles(const QStringList &files)
Set the files that have been uninstalled by the uninstall command.
Definition knewstuff2/core/entry.cpp:256
KNS::Entry::signature
QString signature() const
Returns the signature for the entry.
Definition knewstuff2/core/entry.cpp:211
KNS::Entry::name
KTranslatable name() const
Retrieve the name of the data object.
Definition knewstuff2/core/entry.cpp:81
KNS::Entry::setIdNumber
void setIdNumber(int number)
Definition knewstuff2/core/entry.cpp:246
KNS::Entry::setVersion
void setVersion(const QString &version)
Sets the version number.
Definition knewstuff2/core/entry.cpp:126
KNS::Entry::setDownloads
void setDownloads(int downloads)
Sets the number of downloads.
Definition knewstuff2/core/entry.cpp:186
KNS::Entry::downloads
int downloads() const
Retrieve the download count for the object, which has been determined by its hosting sites and thus m...
Definition knewstuff2/core/entry.cpp:191
KNS::Entry::payload
KTranslatable payload() const
Retrieve the file name of the object.
Definition knewstuff2/core/entry.cpp:161
KNS::Entry::setSignature
void setSignature(const QString &signature)
Sets the signature of the entry.
Definition knewstuff2/core/entry.cpp:206
KNS::Entry::idNumber
int idNumber() const
Definition knewstuff2/core/entry.cpp:251
KNS::Entry::category
QString category() const
Retrieve the category of the data object.
Definition knewstuff2/core/entry.cpp:91
KNS::Entry::status
Status status()
Retrieves the entry's status.
Definition knewstuff2/core/entry.cpp:216
KNS::Entry::Source
Source
Source of the entry, A entry's data is coming from either cache, or an online provider this helps the...
Definition knewstuff2/core/entry.h:319
KNS::Entry::checksum
QString checksum() const
Returns the checksum for the entry.
Definition knewstuff2/core/entry.cpp:201
KNS::Entry::setPayload
void setPayload(const KTranslatable &url)
Sets the object's file.
Definition knewstuff2/core/entry.cpp:156
KNS::Entry::Entry
Entry()
Constructor.
Definition knewstuff2/core/entry.cpp:55
KNS::Entry::setReleaseDate
void setReleaseDate(const QDate &releasedate)
Sets the release date.
Definition knewstuff2/core/entry.cpp:146
KNS::Entry::setCategory
void setCategory(const QString &category)
Sets the data category, e.g.
Definition knewstuff2/core/entry.cpp:86
KNS::Entry::setAuthor
void setAuthor(const Author &author)
Sets the author of the object.
Definition knewstuff2/core/entry.cpp:96
KNS::Entry::setStatus
void setStatus(Status status)
Sets the entry's status.
Definition knewstuff2/core/entry.cpp:221
KNS::Entry::setSource
void setSource(Source source)
Definition knewstuff2/core/entry.cpp:231
KNS::Entry::release
int release() const
Retrieve the release number of the object.
Definition knewstuff2/core/entry.cpp:141
KNS::Entry::version
QString version() const
Retrieve the version string of the object.
Definition knewstuff2/core/entry.cpp:131
KNS::Entry::setPreview
void setPreview(const KTranslatable &url)
Sets the object's preview file, if available.
Definition knewstuff2/core/entry.cpp:166
KNS::Entry::setRelease
void setRelease(int release)
Sets the release number, which is increased for feature-equal objects with the same version number,...
Definition knewstuff2/core/entry.cpp:136
KNS::Entry::Status
Status
Status of the entry.
Definition knewstuff2/core/entry.h:290
KNS::Entry::setChecksum
void setChecksum(const QString &checksum)
Sets the checksum of the entry.
Definition knewstuff2/core/entry.cpp:196
KNS::Entry::~Entry
~Entry()
Destructor.
Definition knewstuff2/core/entry.cpp:71
KNS::Entry::operator=
Entry & operator=(const Entry &other)
Definition knewstuff2/core/entry.cpp:65
KNS::Entry::summary
KTranslatable summary() const
Retrieve a short description about the object.
Definition knewstuff2/core/entry.cpp:121
KNS::Entry::setSummary
void setSummary(const KTranslatable &summary)
Sets a short description on what the object is all about.
Definition knewstuff2/core/entry.cpp:116
KNS::Entry::setName
void setName(const KTranslatable &name)
Sets the name for this data object.
Definition knewstuff2/core/entry.cpp:76
KNS::Entry::rating
int rating() const
Retrieve the rating for the object, which has been determined by its users and thus might change over...
Definition knewstuff2/core/entry.cpp:181
KNS::Entry::author
Author author() const
Retrieve the author of the object.
Definition knewstuff2/core/entry.cpp:101
KNS::Entry::installedFiles
QStringList installedFiles() const
Retrieve the locally installed files.
Definition knewstuff2/core/entry.cpp:241
KNS::Entry::license
QString license() const
Retrieve the license name of the object.
Definition knewstuff2/core/entry.cpp:111
KNS::KTranslatable
String class with multiple localized representations.
Definition ktranslatable.h:42
entry.h
KNS
Definition knewstuff2/core/author.h:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KNewStuff

Skip menu "KNewStuff"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal