[Kde-pim] Propossal: Akonadi::Model::ItemCreateJob

Stephen Kelly steveire at gmail.com
Thu Jun 18 13:34:21 BST 2009


Eduardo Robles Elvira wrote:

> Hello everyone (and Stephen who wrote EntityTreeModel)!

Hi,

> 
> I'm developing the konqueror bookmarks resource for gsoc using Akonadi
> and Nepomuk as some you already know. For the Bookmarks Organizer I
> will be using / extending some model/views provided by Akonadi. For
> displaying the bookmarks I will use EntityTreeModel from akonadi_next.
> 
> One thing I want to be able to do is adding a new bookmark item to the
> model and selecting it immediately so that the user can edit it.
> That's currently not doable with Akonadi models because they're async,
> so currently if I do a ItemCreateJob for adding my new Item, I need to
> wait until the Monitor signals itemAdded() for that item, so that the
> model catches that signal and adds the new item to its internal
> representation. And there's no guarantee that no other monitor signals
> are received before that happens, so one never knows in advance which
> will be the QModelIndex for the added item.

Yes, I've been thinking a bit about async issues with Akonadi, and I think there are more headaches in store.

> 
> For solving that problem, I propose creating
> Akonadi::Model::ItemCreateJob, which I could use this way:

<snip>

I counter-propose that the existing ItemCreateJob get a newItem() method, which would allow using it in a similar way to the ItemFetchJob::items() method. That way we don't have to create new jobs and wrappers, you'd just connect the finished signal to a slot where you call newItem and display that in your dialog.

http://api.kde.org/4.x-api/kdepimlibs-apidocs/akonadi/html/classAkonadi_1_1ItemCreateJob.html

http://api.kde.org/4.x-api/kdepimlibs-apidocs/akonadi/html/classAkonadi_1_1ItemFetchJob.html

I think this solves your open issues too.

All the best,

Steve.

> 
> Regards,
>      Eduardo Robles Elvira.
> _______________________________________________
> 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/


_______________________________________________
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