[Kde-pim] Re: akonadi items with ids

Kevin Krammer kevin.krammer at gmx.at
Tue Feb 15 18:27:52 GMT 2011


On Monday, 2011-02-14, deloptes wrote:
> Tobias König wrote:
> > You are mixing up two things here, the Akonadi IDs and the object UIDs
> > (e.g. UID property of a vCard).
> > While the Akonadi item ID is unique inside an Akonadi system, the object
> > UIDs should be globally unique. So if you want to check if an item with a
> > given object UID is already in the Akonadi store, you have to search for
> > it via ItemSearchJob or its derived implementations
> > ContactSearchJob/IncidenceSearchJob.
> > They will return you the Akonadi item that contains an object (contact or
> > event) with a given UID.
> 
> Hi, thank you. What I mean is if I can set the UID of an Item and not the
> internal storage. Thank you for specifying this.
> 
> The specific question is how I can create an item with a specific UID.
> I did not experiment very carefully but what I've tried did not work as
> expected. What I've tried was to create an Item either with new Item( 123 )
> or set the Id, but invain

Creating an item has two steps:
- first you create an Akonadi::Item instance and specify needed metadata (such 
as MIME type) and data (payload).
- then you let Akonadi know about it by running it through an ItemCreateJob.

Akonadi then assigns an item ID for it and the item create job sets it on the 
item when it emits its result signal.

The data internal UID, e.g. UID of a contact or event, is part of the payload 
data. See e.g. KABC::Addressee::setUid() for contacts.

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: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20110215/590e22d6/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