[Kde-pim] Re: Akonadi::ContactSearchJob

Klaas Freitag freitag at kde.org
Wed Mar 9 08:39:22 GMT 2011


Am Freitag, 4. März 2011, 11:10:52 schrieb Klaas Freitag:

Hi,

really nobody? Does that mean that nobody uses this interface like I do in 
Kraft? 

Please, I already lost a lot of time on this issue, every help is appreciated. 
I have no glue how to debug that, for example how I can verify that 
Akonadi/Nepomuk is running properly (except with akonadiconsole) and
so on. I am really puzzled  :-(

Thanks,
Klaas

> I am trying to get Krafts Addressbook integration to work again and
> experience problems with Akonadi::ContactSearchJob. The returned
> list is always empty. Akonadi is running fine according to akonadiconsole,
> an addressbook and a nepomuk contact feeder is there and ready, I can
> browse the addresses in the akonadiconsole. Kaddressbook works fine, no
> akonadi-related errors are shown in kraft's application output.
> 
> This is the code I am basically using:
> 
> ===
> 
> void AddressProvider::getAddressee( const QString& uid )
> {
>   Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
>   job->setLimit( 100 );
>   job->setQuery( Akonadi::ContactSearchJob::ContactUid , uid );
>   connect( job, SIGNAL(result(KJob*)), this, SLOT(searchResult(KJob* )));
> 
> }
> 
> void AddressProvider::searchResult( KJob* job )
> {
>   Akonadi::ContactSearchJob *searchJob =
> qobject_cast<Akonadi::ContactSearchJob*>( job );
> 
>   if( searchJob->error() ) {
>     kDebug() << "Address search job failed: " << job->errorString();
>     return;
>   }
> 
>   const KABC::Addressee::List contacts = searchJob->contacts();
>   if( contacts.size() > 0 )  {
>     emit addresseeFound( contacts[0] );
>   } else {
>     kDebug() << "Akonadi search result list has size of 0";
>   }
> }
> 
> ====
> copied more or less from the api docs.
> The result is  "Akonadi search result list has size of 0" all the
> time, regardless of what is queried for, even if I search for email which
> is existing.
> 
> Any help is appreciated, I am stuck. Is that still supposed to work? How
> would I debug it?
> 
> Thanks,
> 
> Klaas
> 
> 
> KDE Version is 4.6.00 on openSUSE 11.3 with these package versions:
> freitag at trixa:~/kde/kraft/src> rpm -qa | grep akonadi
> akonadi-runtime-1.4.95-79.2.x86_64
> libakonadi4-4.6.0-201.1.x86_64
> libakonadiprotocolinternals1-1.4.95-79.2.x86_64
> libakonadiprotocolinternals-devel-1.4.95-79.2.x86_64
> 


_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list