Akonadi DBus Interface Contacts

Volker Krause vkrause at kde.org
Sat Mar 19 10:43:06 GMT 2022


On Freitag, 18. März 2022 21:36:25 CET Klaas Freitag wrote:
> in Kraft [1], I have a nice connector to Akonadi to read contacts, that
> works basically like this (example):
> 
> --
>      Akonadi::ContactSearchJob *csjob = new Akonadi::ContactSearchJob(
> this );
>      csjob->setLimit( 1 );
>      csjob->setQuery(ContactSearchJob::ContactUid , uid,
> ContactSearchJob::ExactMatch);
> 
>      csjob->setProperty("UID", uid);
>      connect( csjob, SIGNAL( result( KJob* ) ), this, SLOT(
> searchResult( KJob* ) ) );
>      csjob->start();
>      ...
> --
> 
> That works nicely and users (and myself) are happy.
> 
> But with an AppImage of Kraft, this connection does not work any more
> because of the bin dependency into the host system. AppImage builds have
> a hard time to connect to the host Akonadi. That is an unfortunate downside.

That is indeed an unfortunate situation, the Kalendar team is facing similar 
issues with Flatpaks. There is currently no good way for accessing platform 
PIM services from app bundles AFAIK.

> To solve that, I was wondering if a connection via DBus would help. If
> Kraft could
> 1. query single contacts by the Uid, and
> 2. get a list of all contacts (with limited set of attributes) of a
> resource to build a model for a selection widget
> from Akonadi Contacts via DBus, that would solve the problem in the
> AppImage.
> 
> Is that assumption right? Is Akonadi offering such a DBus interface?
> If so, is there any example code somewhere?

There is no D-Bus interface offering this. It's not impossible to add that, 
but that would likely be a very application-specific workaround, it doesn't 
solve the general problem.

Akonadi uses a mix of local sockets, D-Bus and file system access to 
communicate, that's probably not impossible to route into an app bundle 
either, but that might be a naive assumption on my side, Carl and Clau 
probably have more insights on this.

Regards,
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20220319/b1802bbb/attachment.sig>


More information about the kde-pim mailing list