• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.5 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • Akonadi
  • PersistentSearchAttribute
Public Member Functions
Akonadi::PersistentSearchAttribute Class Reference

#include <persistentsearchattribute.h>

Inheritance diagram for Akonadi::PersistentSearchAttribute:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 PersistentSearchAttribute ()
 ~PersistentSearchAttribute ()
QString queryLanguage () const
QString queryString () const
void setQueryLanguage (const QString &language)
void setQueryString (const QString &query)

Detailed Description

An attribute to store query properties of persistent search collections.

This attribute is attached to persistent search collections automatically when creating a new persistent search with SearchCreateJob. Later on the search query can be changed by modifying this attribute of the persistent search collection with an CollectionModifyJob.

Example:

 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;
   }

   const Collection searchCollection = job->createdCollection();
   ...

   // now let's change the query
   if ( searchCollection.hasAttribute<Akonadi::PersistentSearchAttribute>() ) {
     Akonadi::PersistentSearchAttribute *attribute = searchCollection.attribute<Akonadi::PersistentSearchAttribute>();
     attribute->setQueryString( "... another query string ..." );

     Akonadi::CollectionModifyJob *modifyJob = new Akonadi::CollectionModifyJob( searchCollection );
     connect( modifyJob, SIGNAL( result( KJob* ) ), SLOT( modifyFinished( KJob* ) ) );
   }
   ...
 }
Author:
Volker Krause <vkrause@kde.org>
Since:
4.5

Constructor & Destructor Documentation

Akonadi::PersistentSearchAttribute::PersistentSearchAttribute ( )

Creates a new persistent search attribute.

Akonadi::PersistentSearchAttribute::~PersistentSearchAttribute ( )

Destroys the persistent search attribute.


Member Function Documentation

QString Akonadi::PersistentSearchAttribute::queryLanguage ( ) const

Returns the query language used for this search.

QString Akonadi::PersistentSearchAttribute::queryString ( ) const

Returns the query string used for this search.

void Akonadi::PersistentSearchAttribute::setQueryLanguage ( const QString &  language)

Sets the query language used for this search.

Parameters:
languagethe query language
void Akonadi::PersistentSearchAttribute::setQueryString ( const QString &  query)

Sets the query string to be used for this search.

Parameters:
queryThe query string.

The documentation for this class was generated from the following file:
  • persistentsearchattribute.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Aug 27 2012 22:09:28 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs-4.8.5 API Reference

Skip menu "kdepimlibs-4.8.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal