[Kde-pim] Akonadi ids (was: Re: Data loss: kmail2 must not use existing [Folder-xy] settings on random new folders)

Shaheed Haque srhaque at theiet.org
Fri Dec 16 10:28:51 GMT 2011


For the record, I now see that my understanding of this was sorely lacking.
The resource does not allocate any internal ids at all, which pretty much
invalidates everything else I inferred.

On 13 December 2011 10:21, Shaheed <srhaque at theiet.org> wrote:

>
> In the above referenced thread, Georg seemed to be saying something about
> Akonadi ids which I'd like to get some clarity on. (I'll happily update the
> docs once I know what the answers are, since I think this is affecting some
> resource code I am working on).
>
> This is what I infer so far:
>
>        1. When I create an Akonadi::Item, the id I provide in the
> constructor can
>        be whatever I choose, but it clearly needs to be unique amongst the
> set
>        of ids I am using.
>
>        2. This set of ids is associated with the current resource.
>
>        3. If I enable hierarchical ids, then the the id only needs to be
> unique
>        within the parent collection's set.
>
> Is that correct? Assuming so, I have some questions:
>
>        a. When I set the resource for an Item, I presume I should set it
> to the
>        identifier()  of the resource, not the name(), right?
>
>        b. since the resource for an Item should be immutable, would it not
> be
>        better passed in via the Item constructor?
>
>        c. When I create a new Item locally, when offline, and which I will
> later
>        send to the backend, how should such ids be generated? I obviously
> cannot
>        invent one from the above number space because when the item is
> eventually
>        given to the backend, it will no doubt allocate one itself.
>
> Thanks, Shaheed
>
>
>
_______________________________________________
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