Attica::Metadata
#include <Attica/Metadata>
Public Types | |
enum | Error { NoError = 0, NetworkError, OcsError } |
Public Member Functions | |
Metadata (const Metadata &other) | |
Error | error () const |
QList< QNetworkReply::RawHeaderPair > | headers () const |
int | itemsPerPage () |
QString | message () |
Metadata & | operator= (const Metadata &other) |
QString | resultingId () |
void | setError (Error error) |
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
Status messages from the server
Definition at line 28 of file metadata.h.
Member Function Documentation
◆ error()
Metadata::Error Metadata::error | ( | ) | const |
Check if the job was successful.
- Returns
- the error state enum returns the type of error (network or ocs)
Definition at line 69 of file metadata.cpp.
◆ headers()
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)
- Since
- 5.83
Definition at line 139 of file metadata.cpp.
◆ itemsPerPage()
int Metadata::itemsPerPage | ( | ) |
The number of items per page the server was asked for.
Definition at line 129 of file metadata.cpp.
◆ message()
QString Metadata::message | ( | ) |
An optional additional message from the server.
Definition at line 79 of file metadata.cpp.
◆ resultingId()
QString Metadata::resultingId | ( | ) |
The resulting ID when a PostJob created a new item.
Definition at line 89 of file metadata.cpp.
◆ setHeaders()
void Metadata::setHeaders | ( | const QList< QNetworkReply::RawHeaderPair > & | headers | ) |
Sets the http headers read by headers()
- Parameters
-
headers The new list of raw headers
- Since
- 5.83
Definition at line 144 of file metadata.cpp.
◆ statusCode()
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.
Definition at line 99 of file metadata.cpp.
◆ statusString()
QString Metadata::statusString | ( | ) | const |
The status of the job, for example "Ok".
Definition at line 109 of file metadata.cpp.
◆ totalItems()
int Metadata::totalItems | ( | ) |
The number of items returned by this job (only relevant for list jobs)
Definition at line 119 of file metadata.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Nov 29 2023 04:07:39 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.