KNSCore Namespace Reference


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


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)
QDebug operator<< (QDebug dbg, const Provider::SearchRequest &search)
uint qHash (const KNSCore::EntryInternal &entry)
KNEWSTUFFCORE_EXPORT QString replaceBBCode (const QString &unformattedText)


static const int PreviewHeight = 72
static const int PreviewWidth = 96

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

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.

Definition at line 24 of file errorcode.h.

Function Documentation

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 357 of file atticaprovider.cpp.

QString KNSCore::replaceBBCode ( const QString unformattedText)

function to remove bb code formatting that opendesktop sends

Definition at line 735 of file entryinternal.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu May 13 2021 22:41:56 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.