[Kde-pim] Re: Availability of attributes

Christian Mollekopf chrigi_1 at fastmail.fm
Mon Mar 7 08:18:33 GMT 2011


On Monday 07 March 2011 08:44:15 Kevin Krammer wrote:
> 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.

Ok, so you're saying that if the item was fetched with a normal monitor, NOT 
having:

fetchjob->fetchScope().fetchAttribute<EntityDeletedAttribute>(true);

set, It is also not possible to check if the item has the attribute.
Is there any possibility for me to differentiate between  "Item doesn't have 
this attribute" <-> "We don't know if the item has the attribute or not"?

Cheers,

Chris

> 
> Cheers,
> Kevin
_______________________________________________
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