[Kde-pim] Re: About Kabc ResourceCached addedAddressees

Kevin Krammer kevin.krammer at gmx.at
Mon Feb 28 16:13:26 GMT 2011


Hi,

answering your questions below, but a question from myself ahead:

what is your use case, i.e. what do you want to use ResourceCached for?

I am asking because it is one of the classes related to the KDE Resource 
framework KRES and has been deprecated for a while now.
There might be other ways of doing whatever you are targeting, so it might be 
more helpful to answer questions regarding your goals.

Anyway, as I said, answers to your questions below.

On Monday, 2011-02-28, Sateesh Babu wrote:
> Hi,
> 
> I am trying to use the methods addedAddressees(), changedAddressees()
> and deletedAdressees() in the ResourceCached class. Few questions
> about this:
> 
> * how far are the added, changed and deleted methods track the
> changes? As in are the changes tracked based on timestamp? So in the
> scenario:
> 
> 1) Add 10 contacts
> 2) invoke addedAddressees()
> 3) delete 2 contacts
> 4) invoke deletedAddressees()
> 5) add 4 contacts
> 6) invoke addedAddressees()
> 7) delete 3 contacts
> 8) invoke deletedAddressees()
> 
> In step 6 and 8, would I get 4 contacts added and 3 contacts deleted
> respectively, or will it be a cumulative of all the changes since step
> 1?

Each call to insertAddressee() or removeAddressee() just inserts or moves an 
Addressee instance between three containers.
So on first insertAddressee it ends up in addedAddressees(), the second 
insertAddressee() for the same UID moves it to changedAddressees().
Any call to removeAddressee() moves it to removedAddressees().

> Is it possible to track the changes based on timestamp?

insertAddressee() and removeAddressee() are virtual, you can implement your 
own subclass or subclass of the KABC::Resource base class anyway you want.

> Is there any example code that I can refer to to check how this
> functionality works otherwise?

The KABC classes are part of our kdepimlib repository on git.kde.org
http://quickgit.kde.org/?p=kdepimlibs.git&a=tree

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/20110228/31fb5442/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