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

Stephen Kelly steveire at gmail.com
Fri Jun 19 16:07:19 BST 2009


Hi,

You are correct. I misread your previous mail.

Here's another suggestion from me anyway attached.

The idea is that you create the item synchronously (not ideal) and watch the model somehow. When a new row is inserted, check if it represents the new item (same Id) in the correct collection. The same item could appear in multiple collections (virtual collections). If you get a match, select it in the view.

I didn't compile or test it, but I think it will work, and it won't require patching any of the models. I think it might be useful to have a generic ModelWatcher class anyway because I think we're going to hit more issues like this.

Do you think something like this would work in your case?

> 
> But how does that solve the problem of  knowing the index of the item
> in the model when it's being inserted? I already have a reference to
> the item being inserted, I inserted  it. 

Be careful here. You can't use the id() of items you create and send to Akonadi. They don't have an id() until they come back through a signal. I'm not certain that's what you meant, but thought I'd make sure.

All the best,

Steve.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: newitemwatcher
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20090619/8d7cad5d/attachment.ksh>
-------------- 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