Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Akonadi Contacts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
Akonadi Contacts
Commits
1343a9df
Commit
1343a9df
authored
Nov 13, 2009
by
Tobias Koenig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support to search for all contacts or contact groups of the system
svn path=/trunk/KDE/kdepimlibs/; revision=1048707
parent
4022a3e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
0 deletions
+32
-0
akonadi/contact/contactgroupsearchjob.cpp
akonadi/contact/contactgroupsearchjob.cpp
+6
-0
akonadi/contact/contactsearchjob.cpp
akonadi/contact/contactsearchjob.cpp
+6
-0
akonadi/contact/contactsearchjob.h
akonadi/contact/contactsearchjob.h
+20
-0
No files found.
akonadi/contact/contactgroupsearchjob.cpp
View file @
1343a9df
...
...
@@ -26,6 +26,12 @@ using namespace Akonadi;
ContactGroupSearchJob
::
ContactGroupSearchJob
(
QObject
*
parent
)
:
ItemSearchJob
(
QString
(),
parent
),
d
(
0
)
{
fetchScope
().
fetchFullPayload
();
// by default search for all contact groups
ItemSearchJob
::
setQuery
(
QLatin1String
(
""
"prefix nco:<http://www.semanticdesktop.org/ontologies/2007/03/22/nco#>"
"SELECT ?r WHERE { ?r a nco:ContactGroup }"
)
);
}
ContactGroupSearchJob
::~
ContactGroupSearchJob
()
...
...
akonadi/contact/contactsearchjob.cpp
View file @
1343a9df
...
...
@@ -26,6 +26,12 @@ using namespace Akonadi;
ContactSearchJob
::
ContactSearchJob
(
QObject
*
parent
)
:
ItemSearchJob
(
QString
(),
parent
),
d
(
0
)
{
fetchScope
().
fetchFullPayload
();
// by default search for all contacts
ItemSearchJob
::
setQuery
(
QLatin1String
(
""
"prefix nco:<http://www.semanticdesktop.org/ontologies/2007/03/22/nco#>"
"SELECT ?r WHERE { ?r a nco:PersonContact }"
)
);
}
ContactSearchJob
::~
ContactSearchJob
()
...
...
akonadi/contact/contactsearchjob.h
View file @
1343a9df
...
...
@@ -36,8 +36,11 @@ namespace Akonadi {
* This job searches for contacts that match given search criteria and returns
* the list of contacts.
*
* Examples:
*
* @code
*
* // Search all contacts with email address tokoe@kde.org
* Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
* job->setQuery( Akonadi::ContactSearchJob::Email, "tokoe@kde.org" );
* connect( job, SIGNAL( result( KJob* ) ), this, SLOT( searchResult( KJob* ) ) );
...
...
@@ -53,6 +56,23 @@ namespace Akonadi {
*
* @endcode
*
* @code
*
* // Search for all existing contacts
* Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
* connect( job, SIGNAL( result( KJob* ) ), this, SLOT( searchResult( KJob* ) ) );
*
* ...
*
* MyClass::searchResult( KJob *job )
* {
* Akonadi::ContactSearchJob *searchJob = qobject_cast<Akonadi::ContactSearchJob*>( job );
* const KABC::Addressee::List contacts = searchJob->contacts();
* // do something with the contacts
* }
*
* @endcode
*
* @author Tobias Koenig <tokoe@kde.org>
* @since 4.4
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment