[Kde-pim] [RFC] Contact specific Akonadi API

Kevin Krammer kevin.krammer at gmx.at
Sat Aug 8 14:51:34 BST 2009


On Friday, 2009-08-07, Tobias Koenig wrote:

> So my idea was to provide a job based API like in kdepimlibs/akonadi/ that,
> for the non-gui tasks, just wrapps the ItemXYZJob classes by converting the
> payload from/to KABC::Addressee objects internally. That doesn't add any
> real value but is a nice convenience layer IMHO. Depending on the ctor
> signature, the jobs could behave differently:
>
>   ContactCreateJob( const KABC::Addressee &contact, const
> Akonadi::Collection &collection );
>
> would add the contact directly to the given collection, while
>
>   ContactCreateJob( const KABC::Addressee &contact, QWidget *parent = 0 );
>
> would present a collection selection dialog to the user where he can select
> the collection himself.
>
> The job based API would allow easy usage in asynchronous and synchronous
> code by using start() or exec().

Unless we really want to do GUI inside jobs, I am not sure special subclass 
jobs are really worth the effort.
I am more inclined towards an approach similar to KIO, where a high level API 
creates low level jobs behind the scenes, e.g. similar to

KJob *job = KIO::copy( source, destination );

we could have

Akonadi::Job *job = KABC::createContact( addressee, addressbook );
or maybe more specific
Akonadi::ItemCreateJob* job ...

Cheers,
Kevin
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20090808/3272b144/attachment.sig>
-------------- next part --------------
_______________________________________________
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