akonadi
#include <itemsearchjob.h>
Signals | |
void | itemsReceived (const Akonadi::Item::List &items) |
Signals inherited from Akonadi::Job | |
void | aboutToStart (Akonadi::Job *job) |
void | writeFinished (Akonadi::Job *job) |
Public Member Functions | |
ItemSearchJob (const QString &query, QObject *parent=0) | |
~ItemSearchJob () | |
ItemFetchScope & | fetchScope () |
Item::List | items () const |
void | setFetchScope (const ItemFetchScope &fetchScope) |
void | setQuery (const QString &query) |
Public Member Functions inherited from Akonadi::Job | |
Job (QObject *parent=0) | |
virtual | ~Job () |
virtual QString | errorString () const |
void | start () |
Static Public Member Functions | |
static QUrl | akonadiItemIdUri () |
Protected Member Functions | |
virtual void | doHandleResponse (const QByteArray &tag, const QByteArray &data) |
void | doStart () |
Protected Member Functions inherited from Akonadi::Job | |
virtual bool | addSubjob (KJob *job) |
virtual bool | doKill () |
void | emitWriteFinished () |
virtual bool | removeSubjob (KJob *job) |
Additional Inherited Members | |
Public Types inherited from Akonadi::Job | |
enum | Error { ConnectionFailed = UserDefinedError, ProtocolVersionMismatch, UserCanceled, Unknown, UserError = UserDefinedError + 42 } |
typedef QList< Job * > | List |
Protected Slots inherited from Akonadi::Job | |
virtual void | slotResult (KJob *job) |
Detailed Description
Job that searches for items in the Akonadi storage.
This job searches for items that match a given search query and returns the list of matching item.
Attention: Since this is an ordinary SPARQL query, potentially the whole Nepomuk store is searched, which can be very slow. Therefore, you should create SPARQL queries that only search for items that Akonadi fed into Nepomuk. This can be done by limiting the results to statements that contain the predicate with the akonadiItemIdUri() URI. This limits the search result to to Nepomuk resources that were added by the Akonadi Nepomuk feeders.
- Since
- 4.4
Definition at line 70 of file itemsearchjob.h.
Constructor & Destructor Documentation
|
explicit |
Creates an item search job.
- Parameters
-
query The search query in SPARQL format. parent The parent object.
Definition at line 79 of file itemsearchjob.cpp.
ItemSearchJob::~ItemSearchJob | ( | ) |
Destroys the item search job.
Definition at line 91 of file itemsearchjob.cpp.
Member Function Documentation
|
static |
Returns an URI that represents a predicate that is always added to the Nepomuk resource by the Akonadi Nepomuk feeders.
The statement containing this predicate has the Akonadi Item ID of the resource as string as the object, and the Nepomuk resource, e.g. a PersonContact, as the subject.
Always limit your searches to statements that contain this URI as predicate.
- Since
- 4.4.3
Definition at line 161 of file itemsearchjob.cpp.
|
protectedvirtual |
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.
Definition at line 127 of file itemsearchjob.cpp.
|
protectedvirtual |
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.
Definition at line 116 of file itemsearchjob.cpp.
ItemFetchScope & ItemSearchJob::fetchScope | ( | ) |
Returns the item fetch scope.
Since this returns a reference it can be used to conveniently modify the current scope in-place, i.e. by calling a method on the returned reference without storing it in a local variable. See the ItemFetchScope documentation for an example.
- Returns
- a reference to the current item fetch scope
- See also
- setFetchScope() for replacing the current item fetch scope
Definition at line 109 of file itemsearchjob.cpp.
Item::List ItemSearchJob::items | ( | ) | const |
Returns the items that matched the search query.
Definition at line 154 of file itemsearchjob.cpp.
|
signal |
This signal is emitted whenever new matching items have been fetched completely.
- Note
- This is an optimization, instead of waiting for the end of the job and calling items(), you can connect to this signal and get the items incrementally.
- Parameters
-
items The matching items.
void ItemSearchJob::setFetchScope | ( | const ItemFetchScope & | fetchScope | ) |
Sets the item fetch scope.
The ItemFetchScope controls how much of an matching item's data is fetched from the server, e.g. whether to fetch the full item payload or only meta data.
- Parameters
-
fetchScope The new scope for item fetch operations.
- See also
- fetchScope()
Definition at line 102 of file itemsearchjob.cpp.
void ItemSearchJob::setQuery | ( | const QString & | query | ) |
Sets the search query
in SPARQL format.
Definition at line 95 of file itemsearchjob.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:29 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.