[Kde-pim] Re: Availability of attributes

Kevin Krammer kevin.krammer at gmx.at
Mon Mar 7 07:44:15 GMT 2011


On Monday, 2011-03-07, Christian Mollekopf wrote:
> Hi,
> 
> I need to know in the trash job, if an item/collection already has an
> attribute or not. I know that I have to fetch the attribute if I need the
> content of the attribute, but I'm not sure if I need to fetch it as well if
> I just need to know if the entity has the attribute using:
> 
> item.hasAttribute<Akonadi::EntityDeletedAttribute>()

It depends on how you got the item.

If you created the item locally and did not add the attribute yourself, you 
have no way of knowing whether someone else has added it.

If you got the item through a monitor, you can use the monitor's item fetch 
scope to make sure if gets the attribute if it exists.

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/20110307/fc172cf4/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