akonadi
Akonadi::ItemModifyJob Class Reference
Job that modifies an existing item in the Akonadi storage. More...
#include <itemmodifyjob.h>

Public Member Functions | |
ItemModifyJob (const Item &item, QObject *parent=0) | |
virtual | ~ItemModifyJob () |
void | disableRevisionCheck () |
bool | ignorePayload () const |
Item | item () const |
void | setIgnorePayload (bool ignore) |
Protected Member Functions | |
virtual void | doHandleResponse (const QByteArray &tag, const QByteArray &data) |
virtual void | doStart () |
Detailed Description
Job that modifies an existing item in the Akonadi storage.
This job is used to writing back items to the Akonadi storage, after the user has changed them in any way. For performance reasons either the full item (including the full payload) can written back or only the meta data of the item.
Example:
// Fetch item with unique id 125 Akonadi::ItemFetchJob *fetchJob = new Akonadi::ItemFetchJob( Akonadi::Item( 125 ) ); connect( fetchJob, SIGNAL( result( KJob* ) ), SLOT( fetchFinished( KJob* ) ) ); ... MyClass::fetchFinished( KJob *job ) { if ( job->error() ) return; Akonadi::ItemFetchJob *fetchJob = qobject_cast<Akonadi::ItemFetchJob*>( job ); Akonadi::Item item = fetchJob->items().first(); // Set a custom flag item.setFlag( "\GotIt" ); // Store back modified item Akonadi::ItemModifyJob *modifyJob = new Akonadi::ItemModifyJob( item ); connect( modifyJob, SIGNAL( result( KJob* ) ), SLOT( modifyFinished( KJob* ) ) ); } MyClass::modifyFinished( KJob *job ) { if ( job->error() ) qDebug() << "Error occurred"; else qDebug() << "Item modified successfully"; }
Definition at line 80 of file itemmodifyjob.h.
Constructor & Destructor Documentation
Akonadi::ItemModifyJob::ItemModifyJob | ( | const Item & | item, | |
QObject * | parent = 0 | |||
) | [explicit] |
Creates a new item modify job.
- Parameters:
-
item The modified item object to store. parent The parent object.
virtual Akonadi::ItemModifyJob::~ItemModifyJob | ( | ) | [virtual] |
Destroys the item modify job.
Member Function Documentation
void Akonadi::ItemModifyJob::disableRevisionCheck | ( | ) |
Disables the check of the revision number.
- Note:
- If disabled, no conflict detection is available.
virtual void Akonadi::ItemModifyJob::doHandleResponse | ( | const QByteArray & | tag, | |
const QByteArray & | data | |||
) | [protected, virtual] |
This method should be reimplemented in the concrete jobs in case you want to handle incoming data.
It will be called on received data from the backend. The default implementation does nothing.
- Parameters:
-
tag The tag of the corresponding command, empty if this is an untagged response. data The received data.
Reimplemented from Akonadi::Job.
virtual void Akonadi::ItemModifyJob::doStart | ( | ) | [protected, virtual] |
This method must be reimplemented in the concrete jobs.
It will be called after the job has been started and a connection to the Akonadi backend has been established.
Implements Akonadi::Job.
bool Akonadi::ItemModifyJob::ignorePayload | ( | ) | const |
Returns whether the payload of the modified item shall be omitted from transmission to the Akonadi storage.
Item Akonadi::ItemModifyJob::item | ( | ) | const |
Returns the modified and stored item including the changed revision number.
void Akonadi::ItemModifyJob::setIgnorePayload | ( | bool | ignore | ) |
Sets whether the payload of the modified item shall be omitted from transmission to the Akonadi storage.
The default is false
, however it can be set for performance reasons.
The documentation for this class was generated from the following file: