akonadi/contact
22 #include "contactgroupsearchjob.h"
24 #include <akonadi/itemfetchscope.h>
26 using namespace Akonadi;
28 class ContactGroupSearchJob::Private
35 : ItemSearchJob( QString(), parent ), d( new Private )
37 fetchScope().fetchFullPayload();
42 #ifdef AKONADI_USE_STRIGI_SEARCH
46 " <field name=\"type\"/>"
47 " <string>ContactGroup</string>"
52 "prefix nco:<http://www.semanticdesktop.org/ontologies/2007/03/22/nco#>"
53 "SELECT ?r WHERE { ?r a nco:ContactGroup }"
74 #ifndef AKONADI_USE_STRIGI_SEARCH
75 query = QString::fromLatin1(
"prefix nco:<http://www.semanticdesktop.org/ontologies/2007/03/22/nco#>" );
79 if ( criterion ==
Name ) {
80 query += QString::fromLatin1(
81 #ifdef AKONADI_USE_STRIGI_SEARCH
86 " <field name=\"type\"/>"
87 " <string>ContactGroup</string>"
90 " <field name=\"contactGroupName\"/>"
91 " <string>%1</string>"
97 "SELECT DISTINCT ?group "
100 " ?group <" + akonadiItemIdUri().toEncoded() +
"> ?itemId . "
101 " ?group nco:contactGroupName \"%1\"^^<http://www.w3.org/2001/XMLSchema#string>."
108 if ( criterion ==
Name ) {
109 query += QString::fromLatin1(
110 #ifdef AKONADI_USE_STRIGI_SEARCH
115 " <field name=\"type\"/>"
116 " <string>ContactGroup</string>"
119 " <field name=\"contactGroupName\"/>"
120 " <string>%1</string>"
126 "SELECT DISTINCT ?group "
129 " ?group <" + akonadiItemIdUri().toEncoded() +
"> ?itemId . "
130 " ?group nco:contactGroupName ?v . "
131 " ?v bif:contains \"'%1'\""
138 if ( criterion ==
Name ) {
139 query += QString::fromLatin1(
140 #ifdef AKONADI_USE_STRIGI_SEARCH
145 " <field name=\"type\"/>"
146 " <string>ContactGroup</string>"
149 " <field name=\"contactGroupName\"/>"
150 " <string>%1</string>"
156 "SELECT DISTINCT ?group "
159 " ?group <" + akonadiItemIdUri().toEncoded() +
"> ?itemId . "
160 " ?group nco:contactGroupName ?v . "
161 " ?v bif:contains \"'%1*'\""
169 if ( d->mLimit != -1 ) {
170 #ifndef AKONADI_USE_STRIGI_SEARCH
171 query += QString::fromLatin1(
" LIMIT %1" ).arg( d->mLimit );
175 query = query.arg( value );
189 foreach (
const Item &item, items() ) {
190 if ( item.hasPayload<KABC::ContactGroup>() )
191 contactGroups.append( item.payload<KABC::ContactGroup>() );
197 #include "contactgroupsearchjob.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Tue Dec 11 2012 12:15:27 by
doxygen 1.8.1.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.