Attica::Metadata Class

class Attica::Metadata

Status messages from the server. More...

Header: #include <Attica/Metadata>
CMake: find_package(KF6 REQUIRED COMPONENTS Attica)
target_link_libraries(mytarget PRIVATE KF6::Attica)

Public Types

enum Error { NoError, NetworkError, OcsError }

Public Functions

Metadata()
Attica::Metadata::Error error() const
(since 5.83) QList<QNetworkReply::RawHeaderPair> headers() const
int itemsPerPage()
QString message()
QString resultingId()
void setError(Attica::Metadata::Error error)
(since 5.83) void setHeaders(const QList<QNetworkReply::RawHeaderPair> &headers)
void setItemsPerPage(int itemsPerPage)
void setMessage(const QString &message)
void setResultingId(const QString &id)
void setStatusCode(int code)
void setStatusString(const QString &status)
void setTotalItems(int items)
int statusCode() const
QString statusString() const
int totalItems()

Detailed Description

Member Type Documentation

enum Metadata::Error

ConstantValue
Attica::Metadata::NoError0
Attica::Metadata::NetworkError1
Attica::Metadata::OcsError2

Member Function Documentation

Metadata::Metadata()

Attica::Metadata::Error Metadata::error() const

Check if the job was successful.

Returns the error state enum returns the type of error (network or ocs)

See also setError().

[since 5.83] QList<QNetworkReply::RawHeaderPair> Metadata::headers() const

The http headers for the most recent network action in the case of a network error

Use this to further inspect the error condition if the OCS status code and string is not enough to work out precisely what has happened (for example in case of a HTTP 503 status, which would suggest the service is down for maintenance for an expected duration which might be read from the Retry-After header).

Returns the list of raw headers (equivalent to a QNetworkReply::rawHeaderPairs call)

This function was introduced in 5.83.

See also setHeaders().

int Metadata::itemsPerPage()

The number of items per page the server was asked for

See also setItemsPerPage().

QString Metadata::message()

An optional additional message from the server

See also setMessage().

QString Metadata::resultingId()

The resulting ID when a PostJob created a new item.

See also setResultingId().

void Metadata::setError(Attica::Metadata::Error error)

See also error().

[since 5.83] void Metadata::setHeaders(const QList<QNetworkReply::RawHeaderPair> &headers)

Sets the http headers read by headers()

headers The new list of raw headers

This function was introduced in 5.83.

See also headers().

void Metadata::setItemsPerPage(int itemsPerPage)

See also itemsPerPage().

void Metadata::setMessage(const QString &message)

See also message().

void Metadata::setResultingId(const QString &id)

See also resultingId().

void Metadata::setStatusCode(int code)

See also statusCode().

void Metadata::setStatusString(const QString &status)

See also statusString().

void Metadata::setTotalItems(int items)

See also totalItems().

int Metadata::statusCode() const

The status as integer.

If the error is an OCS error, refer to http://www.freedesktop.org/wiki/Specifications/open-collaboration-services in any other case it is the network return code.

See also setStatusCode().

QString Metadata::statusString() const

The status of the job, for example "Ok"

See also setStatusString().

int Metadata::totalItems()

The number of items returned by this job (only relevant for list jobs)

See also setTotalItems().