KNSCore Namespace Reference


class  Author
class  CommentsModel
class  DownloadManager
class  Engine
class  EntryInternal
class  EntryWrapper
class  Installation
class  KPackageJob
class  Provider
class  ProvidersModel
class  Question
class  QuestionListener
class  QuestionManager
class  Security
class  TagsFilterChecker
class  XmlLoader


using Entry = KNSCore::EntryInternal
typedef QFlags< JobFlag > JobFlags
typedef QHash< const Provider *, ProviderPrivate * > ProviderPrivateHash


enum  ErrorCode {
  UnknownError, NetworkError, OcsError, ConfigFileError,
  ProviderError, InstallationError, ImageError, AdoptionError,
enum  JobFlag {
  None = 0, HideProgressInfo = 1, Resume = 2, Overwrite = 4,
  DefaultFlags = None
enum  LoadType { Reload, NoReload }


QDomElement addElement (QDomDocument &doc, QDomElement &parent, const QString &tag, const QString &value)
static ProviderPrivate * d (const Provider *provider)
static void delete_d (const Provider *provider)
QList< std::shared_ptr< KNSCore::Comment > > getCommentsList (const Attica::Comment::List &comments, std::shared_ptr< KNSCore::Comment > parent)
void handleData (XmlLoader *q, const QByteArray &data)
QDebug operator<< (QDebug dbg, const Provider::SearchRequest &search)
uint qHash (const KNSCore::EntryInternal &entry)
KNEWSTUFFCORE_EXPORT QString replaceBBCode (const QString &unformattedText)


static const QLatin1String ATTR_CURRENCY_CODE {"currencycode"}
static const QLatin1String FEED_COMPLETE {"fh:complete"}
static const QLatin1String HTML_MT {"text/html"}
static const QLatin1String KEY_LANGUAGE {"data##language="}
static const QLatin1String KEY_MIME_TYPE {"data##mimetype="}
static const QLatin1String KEY_URL {"data##url="}
static const QLatin1String OPDS_ATOM_MT {"application/atom+xml"}
static const QLatin1String OPDS_ATTR_ACTIVE_FACET {"opds:activeFacet"}
static const QLatin1String OPDS_ATTR_FACET_GROUP {"opds:facetGroup"}
static const QLatin1String OPDS_EL_INDIRECT {"opds:indirectAcquisition"}
static const QLatin1String OPDS_EL_PRICE {"opds:price"}
static const QLatin1String OPDS_KIND_ACQUISITION {"kind=acquisition"}
static const QLatin1String OPDS_KIND_NAVIGATION {"kind=navigation"}
static const QLatin1String OPDS_PROFILE {"profile=opds-catalog"}
static const QLatin1String OPDS_REL_AC_BORROW {""}
static const QLatin1String OPDS_REL_AC_BUY {""}
static const QLatin1String OPDS_REL_AC_OPEN_ACCESS {""}
static const QLatin1String OPDS_REL_AC_SAMPLE {""}
static const QLatin1String OPDS_REL_AC_SUBSCRIBE {""}
static const QLatin1String OPDS_REL_ACQUISITION {""}
static const QLatin1String OPDS_REL_CRAWL {""}
static const QLatin1String OPDS_REL_FACET {""}
static const QLatin1String OPDS_REL_FEATURED {""}
static const QLatin1String OPDS_REL_IMAGE {""}
static const QLatin1String OPDS_REL_RECOMMENDED {""}
static const QLatin1String OPDS_REL_SHELF {""}
static const QLatin1String OPDS_REL_SORT_NEW {""}
static const QLatin1String OPDS_REL_SORT_POPULAR {""}
static const QLatin1String OPDS_REL_SUBSCRIPTIONS {""}
static const QLatin1String OPDS_REL_THUMBNAIL {""}
static const QLatin1String OPDS_TYPE_ENTRY {"type=entry"}
static const QLatin1String OPENSEARCH_ATTR_TEMPLATE {"template"}
static const QLatin1String OPENSEARCH_ATTR_TYPE {"type"}
static const QLatin1String OPENSEARCH_COUNT {"count"}
static const QLatin1String OPENSEARCH_EL_URL {"Url"}
static const QLatin1String OPENSEARCH_MT {"application/opensearchdescription+xml"}
static const QLatin1String OPENSEARCH_NS {""}
static const QLatin1String OPENSEARCH_SEARCH_TERMS {"searchTerms"}
static const QLatin1String OPENSEARCH_START_INDEX {"startIndex"}
static const QLatin1String OPENSEARCH_START_PAGE {"startPage"}
static const int PreviewHeight = 72
static const int PreviewWidth = 96
static const QLatin1String REL_ALTERNATE {"alternate"}
static const QLatin1String REL_COLLECTION {"collection"}
static const QLatin1String REL_FIRST {"first"}
static const QLatin1String REL_LAST {"last"}
static const QLatin1String REL_NEXT {"next"}
static const QLatin1String REL_PREVIEW {"preview"}
static const QLatin1String REL_PREVIOUS {"previous"}
static const QLatin1String REL_RELATED {"related"}
static const QLatin1String REL_REPLIES {"replies"}
static const QLatin1String REL_SEARCH {"search"}
static const QLatin1String REL_SELF {"self"}
static const QLatin1String REL_START {"start"}
static const QLatin1String REL_SUBSECTION {"subsection"}
static const QLatin1String REL_UP {"up"}
static const QLatin1String THREAD_COUNT {"count"}

Detailed Description

Contains the core functionality for handling interaction with NewStuff providers.

The entrypoint for most things will be the creation of an instance of KNSCore::Engine which will other classes then either use or get instantiated from directly.

NOTE: When implementing anything on top of KNSCore, without using either KNS3 or the Qt Quick components, you will need to implement a custom QuestionListener (see that class for instructions)

See also

Enumeration Type Documentation

◆ ErrorCode

An enumeration of specific error conditions which might occur and which users of KNewStuff would want to react to.

It is used by both the Engine and Provider classes.

5.53 TODO: KF6 do not repeat entry properties in the QVariantList

An unknown error (this should not be used, an error report of this nature should be considered a bug)


A network error. In signalErrorCode, this will be accompanied by the QtNetwork error code in the metadata.


An error reported by the OCS API server. In signalErrorCode, this will be accompanied by the OCS error code in the metadata.


The configuration file is missing or somehow incorrect. The configuration file filename will be held in the metadata.


A provider has failed to load or initialize. The provider file URL or provider URL will be held in the metadata.


Installation of a content item has failed. If known, the entry's unique ID will be the metadata.


Loading an image has failed. The entry name and preview type which failed will be held in the metadata as a QVariantList.


Adopting one entry has failed. The adoption command will be in the metadata as a QVariantList.


Specific error condition for failed network calls which explicitly request an amount of time to wait before retrying (generally interpreted as maintenance).

The retry will be scheduled automatically, and this code can be used to show the user how long they have to wait. The time after which the user can try again can be read as a QDateTime in the metadata.


Definition at line 24 of file errorcode.h.

Function Documentation

◆ getCommentsList()

QList<std::shared_ptr<KNSCore::Comment> > KNSCore::getCommentsList ( const Attica::Comment::List &  comments,
std::shared_ptr< KNSCore::Comment parent 

TODO KF6 QList is discouraged, and we'll probably want to switch this (and the rest of the KNS library) to QVector instead.

Definition at line 361 of file atticaprovider.cpp.

◆ replaceBBCode()

QString KNSCore::replaceBBCode ( const QString unformattedText)

function to remove bb code formatting that opendesktop sends

Definition at line 752 of file entryinternal.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Dec 6 2023 03:57:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.