Pages
API Documentation
On this page

KNSCore::Entry Class

KNewStuff data entry container. More...

  • Header: #include <Entry>
  • CMake: find_package(KF6 REQUIRED COMPONENTS NewStuff)
    target_link_libraries(mytarget PRIVATE KF6::NewStuff)

List of all members, including inherited members

Public Types

Properties

Public Functions

Detailed Description

This class provides accessor methods to the data objects as used by KNewStuff.

Maintainer: Jeremy Whiting ()

Member Type Documentation

enum Entry::EntryEvent

Constant Value Description
KNSCore::Entry::UnknownEvent 0 A generic event, not generally used.
KNSCore::Entry::StatusChangedEvent 1 Used when an event's status is set (use Entry::status() to get the new status).
KNSCore::Entry::AdoptedEvent 2 Used when an entry has been successfully adopted (use this to determine whether a call to Engine::adoptEntry() succeeded).
KNSCore::Entry::DetailsLoadedEvent 3 Used when more details have been added to an existing entry (such as the full description), and the UI should be updated.

enum Entry::EntryType

Represents whether the current entry is an actual catalog entry, or an entry that represents a set of entries.

Constant Value Description
KNSCore::Entry::CatalogEntry 0 These are the main entries that KNewStuff can get the details about and download links for.
KNSCore::Entry::GroupEntry 1 These are entries whose payload is another feed. Currently only used by the OPDS provider.

enum Entry::PreviewType

Defines the entry's preview image type.

Constant
KNSCore::Entry::PreviewSmall1 0
KNSCore::Entry::PreviewSmall2 1
KNSCore::Entry::PreviewSmall3 2
KNSCore::Entry::PreviewBig1 3
KNSCore::Entry::PreviewBig2 4
KNSCore::Entry::PreviewBig3 5

See also previewImage, previewUrl, setPreviewImage, setPreviewUrl

enum Entry::Source

Source of the entry.

An entry's data is coming from either cache, or an online provider. This helps the engine know which data to use when merging cached entries with online entry data.

Constant
KNSCore::Entry::Cache 0
KNSCore::Entry::Online 1
KNSCore::Entry::Registry 2

See also setSource, source

enum Entry::Status

Status of the entry.

An entry will be downloadable from the provider's site prior to the download. Once downloaded and installed, it will be either installed or updateable, implying an out-of-date installation. Finally, the entry can be deleted and hence show up as downloadable again.

Entries not taking part in this cycle, for example those in upload, have an invalid status.

Constant
KNSCore::Entry::Invalid 0
KNSCore::Entry::Downloadable 1
KNSCore::Entry::Installed 2
KNSCore::Entry::Updateable 3
KNSCore::Entry::Deleted 4
KNSCore::Entry::Installing 5
KNSCore::Entry::Updating 6

See also setStatus, status

Property Documentation

[read-only] author : KNSCore::Author

Access functions:

  • KNSCore::Author author() const

Access functions:

[read-only] downloadCount : int

Access functions:

Access functions:

[read-only] entryType : KNSCore::Entry::EntryType

Access functions:

  • KNSCore::Entry::EntryType entryType() const

[read-only] homepage : QUrl

Access functions:

[read-only] name : QString

Access functions:

  • QString name() const

[read-only] numberOfComments : int

Access functions:

[read-only] providerId : QString

Access functions:

[read-only] rating : int

Access functions:

[read-only] shortSummary : QString

Access functions:

[read-only] status : KNSCore::Entry::Status

Access functions:

  • KNSCore::Entry::Status status() const

[read-only] summary : QString

Access functions:

[read-only] uniqueId : QString

Access functions:

Member Function Documentation

Entry::Entry()

Constructor.

[noexcept] Entry::~Entry()

Destructor.

void Entry::appendDownloadLinkInformation(const KNSCore::Entry::DownloadLinkInformation &info)

Adds a new download option to this entry.

info is the new download option

See also clearDownloadLinkInformation, downloadLinkInformationList

KNSCore::Author Entry::author() const

Returns the author of the object.

Note: Getter function for property author.

See also setAuthor()

QString Entry::category() const

Returns the category of the data object. This is the category's name or ID (as opposed to displayName).

See also setCategory(), KNSCore::Provider::CategoryMetadata, KNSCore::EngineBase::categories()

QString Entry::changelog() const

Returns the user written changelog.

See also setChangelog()

void Entry::clearDownloadLinkInformation()

Removes all download options from this entry

See also appendDownloadLinkInformation, downloadLinkInformationList

Returns a string representing the URL for a website where the user can donate to the author of this entry.

Note: Getter function for property donationLink.

See also setDonationLink()

int Entry::downloadCount() const

Returns the download count for the object, which has been determined by its hosting sites and thus might change over time.

Note: Getter function for property downloadCount.

int Entry::downloadLinkCount() const

Returns the number of available download options for this entry.

See also downloadLinkInformationList

QList<KNSCore::Entry::DownloadLinkInformation> Entry::downloadLinkInformationList() const

Returns a list of downloadable data for this entry.

Note: Getter function for property downloadLinks.

See also appendDownloadLinkInformation, DownloadLinkInformation

KNSCore::Entry::EntryType Entry::entryType() const

Returns the entry's type.

Note: Getter function for property entryType.

See also setEntryType()

QUrl Entry::homepage() const

A link to a website containing information about this entry

Returns The URL representing the entry's website

Note: Getter function for property homepage.

See also setHomepage()

QStringList Entry::installedFiles() const

Returns the locally installed files.

See also setInstalledFiles()

Returns the link for the knowledgebase for this entry.

See also setKnowledgebaseLink()

QString Entry::license() const

Returns the license name of the object.

See also setLicense()

QString Entry::name() const

Returns the name of the data object (potentially translated).

Note: Getter function for property name.

See also setName()

int Entry::numberFans() const

Returns how many people have marked themselves as fans of this entry.

See also setNumberFans(), KNSCore::EngineBase::becomeFan

int Entry::numberKnowledgebaseEntries() const

Returns the number of entries in the knowledgebase for this entry.

See also setNumberKnowledgebaseEntries()

int Entry::numberOfComments() const

Returns the number of comments against the asset.

Note: Getter function for property numberOfComments.

QString Entry::payload() const

Returns the object's filename.

See also setPayload()

QImage Entry::previewImage(KNSCore::Entry::PreviewType type = PreviewSmall1) const

Returns the entry's preview image of the specified type.

type is the desired preview image type

Note: This will not be loaded automatically, instead use Engine to load the actual images.

See also setPreviewImage()

QString Entry::previewUrl(KNSCore::Entry::PreviewType type = PreviewSmall1) const

Returns the file name of an image containing a preview of the object.

type is the desired preview image type

See also setPreviewUrl()

QString Entry::providerId() const

Returns the id of the provider this entry belongs to.

Note: Getter function for property providerId.

See also setProviderId()

int Entry::rating() const

Returns the rating for the object, which has been determined by its users and thus might change over time.

Note: Getter function for property rating.

QDate Entry::releaseDate() const

Returns the object's release date.

See also setReleaseDate()

void Entry::setAuthor(const KNSCore::Author &author)

Sets the author of the object.

See also author()

void Entry::setCategory(const QString &category)

Sets the data category, e.g. "KWin Scripts" or "Plasma Theme".

See also category()

void Entry::setChangelog(const QString &changelog)

Sets the user written changelog.

See also changelog()

Sets a string representation of the URL for the donation website for this entry.

Note: This is not checked for validity, the caller must do this.

link is the string version of the URL for the entry's donation website

See also donationLink()

void Entry::setEntryType(KNSCore::Entry::EntryType type)

Sets the entry's type.

See also entryType()

bool Entry::setEntryXML(QXmlStreamReader &reader)

Sets the XML for the entry.

This method parses the xml and sets the private members accordingly used to deserialize data loaded from provider.

reader defines where to read the XML string from

Returns whether or not setting the values was successful

void Entry::setHomepage(const QUrl &page)

Set a link to a website containing information about this entry

page The URL representing the entry's website

See also homepage()

void Entry::setInstalledFiles(const QStringList &files)

Sets the files that have been installed by the install command.

files is the list of local file names

See also installedFiles()

Set the link for the knowledgebase.

Note: This is not checked for validity, the caller must do this.

link is the string version of the URL for the knowledgebase

See also knowledgebaseLink()

void Entry::setLicense(const QString &license)

Sets the license (abbreviation) applicable to the object.

See also license()

void Entry::setName(const QString &name)

Sets the name for this data object.

See also name()

void Entry::setNumberFans(int fans)

Sets how many people are fans.

Note: This is purely informational. To become a fan, call the KNSCore::Engine::becomeFan function.

fans The number of fans this entry has

See also numberFans(), KNSCore::EngineBase::becomeFan

void Entry::setNumberKnowledgebaseEntries(int num)

Sets the number of knowledgebase entries for this entry.

num is the number of entries

See also numberKnowledgebaseEntries()

void Entry::setPayload(const QString &url)

Sets the object's filename to url.

See also payload()

void Entry::setPreviewImage(const QImage &image, KNSCore::Entry::PreviewType type = PreviewSmall1)

Sets the entry's preview image for the specified preview type.

image is the image URL

type is the preview image type

See also previewImage()

void Entry::setPreviewUrl(const QString &url, KNSCore::Entry::PreviewType type = PreviewSmall1)

Sets the object's preview image file, if available.

url is the URL of the preview image file

type is the preview image type

See also previewUrl()

void Entry::setProviderId(const QString &id)

Sets the id of the provider this entry belongs to.

See also providerId()

void Entry::setReleaseDate(const QDate &releasedate)

Sets the release date to releasedate.

See also releaseDate()

void Entry::setShortSummary(const QString &summary)

Sets a short summary of what the object is all about (should be very short)

See also shortSummary()

void Entry::setSource(KNSCore::Entry::Source source)

Sets the source of this entry.

See also source()

void Entry::setStatus(KNSCore::Entry::Status status)

Sets the entry's status. If no status is set, the default will be Invalid.

Note that while this enum is currently found in KNS3::Entry, it will be moved to this class once the binary compatibility lock is lifted for Frameworks 6. For now, you should read any reference to the KNS3::Entry::Status enumerator as KNSCore::Entry::Status

status New status of the entry

See also status()

void Entry::setSummary(const QString &summary)

Sets a summary (which can potentially be very long)

See also summary()

void Entry::setTags(const QStringList &tags)

Sets the tags for the content item.

tags is a string list containing the tags for this entry

See also tags()

void Entry::setUniqueId(const QString &id)

Set the object's unique ID. This must be unique to the provider.

id The unique ID of this entry as unique to this provider

See also uniqueId(), KNSCore::Provider

void Entry::setUpdateReleaseDate(const QDate &releasedate)

Sets the release date that is available as update to releasedate.

See also updateReleaseDate()

void Entry::setUpdateVersion(const QString &version)

Sets the version number that is available as update.

See also updateVersion()

void Entry::setVersion(const QString &version)

Sets the version number.

See also version()

QString Entry::shortSummary() const

Returns a short description of what the object is all about (should be very short).

Note: Getter function for property shortSummary.

See also setShortSummary()

KNSCore::Entry::Source Entry::source() const

Returns the source of this entry.

See also setSource()

KNSCore::Entry::Status Entry::status() const

Returns the entry's status.

Note: Getter function for property status.

See also setStatus()

QString Entry::summary() const

Returns a (potentially very long) description of the object.

Note: Getter function for property summary.

See also setSummary()

QStringList Entry::tags() const

Returns the set of tags assigned specifically to this content item. This does not include tags for the download links. To get those, you must concatenate the lists yourself.

See also setTags(), downloadLinkInformationList(), KNSCore::Entry::DownloadLinkInformation, EngineBase::setTagFilter

QStringList Entry::uninstalledFiles() const

Returns the locally uninstalled files.

QString Entry::uniqueId() const

Get the object's unique ID. This will be unique to the provider. This is not intended as user-facing information - though it can be useful for certain purposes, this is supposed to only be used for keeping track of the entry.

Returns The unique ID of this entry

Note: Getter function for property uniqueId.

See also setUniqueId()

QDate Entry::updateReleaseDate() const

Returns the date of the newer version that is available as update.

See also setUpdateReleaseDate()

QString Entry::updateVersion() const

Returns the version string of the object that is available as update.

See also setUpdateVersion()

QString Entry::version() const

Returns the version number string of the object.

See also setVersion()

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.