Akonadi.SearchCreateJob

KDE 4.7 PyKDE API Reference

- KDE's Python API

# SearchCreateJob Class Reference

`from PyKDE4.akonadi import *`

Inherits: Akonadi.Job → KCompositeJob → KJob → QObject
Namespace: Akonadi

## Detailed Description

Job that creates a virtual/search collection in the Akonadi storage.

This job creates so called virtual or search collections, which don't contain real data, but references to items that match a given search query.

     const QString name = "My search folder";
     const QString query = "...";

     Akonadi.SearchCreateJob *job = new Akonadi.SearchCreateJob( name, query );
     connect( job, SIGNAL( result( KJob* ) ), SLOT( jobFinished( KJob* ) ) );

     MyClass.jobFinished( KJob *job )
     {
       if ( job->error() ) {
         qDebug() << "Error occurred";
         return;
       }

       qDebug() << "Created search folder successfully";
       const Collection searchCollection = job->createdCollection();
       ...
     }

Author:
  Volker Krause <vkrause@kde.org>

## Methods
| __init__ (self, QString name, QString query, QObject parent=0)
Akonadi.Collection | createdCollection (self)
| doHandleResponse (self, QByteArray tag, QByteArray data)
| doStart (self)
| setQueryLanguage (self, QString queryLanguage)

## Method Documentation

__init__ | ( | self, |
|  | QString | name,
|  | QString | query,
|  | QObject | parent=0
| ) |  |  |

Creates a search create job.

Parameters:

  | name | The name of the search collection.
  | query | The search query (format not defined yet).
  | parent | The parent object.

Akonadi.Collection createdCollection | ( |  | self ) |

Returns the newly created search collection once the job finished successfully. Returns an invalid collection if the job has not yet finished or failed.

Since:
  4.4

doHandleResponse | ( | self, |
|  | QByteArray | tag,
|  | QByteArray | data
| ) |  |  |

Reimplemented from Akonadi.Job

doStart | ( |  | self ) |

Reimplemented from Akonadi.Job

setQueryLanguage | ( | self, |
|  | QString | queryLanguage
| ) |  |  |

Sets the query language.

Parameters:

  | queryLanguage | The query language used.

Since:
  4.6