Bug Fixes in KDE-PIM
Fixed refcounting in ETM and Monitor
This is a combination of several commits in order to fix the buffering
in the ETM.
In particular it incorporates the following changes:
Fixed fetching of items that exited the buffer after being referenced.
After a collection exits the buffer after being referenced,
the monitor no longer emits updates for this collection.
It is therefore necessary for the ETM to refetch the items to get missing updates.
2. (regarding the removal of the MAXITEMS limit)
Don't keep outdated copies of items.
A collection is purged if reference counting is used and a collection
exits the buffer after being referenced. By not purging the items, it becomes
possile that we miss updates, and when refetching the collection because it's
referenced again, we don't emit change notifications because the items were in the model already.
Since we anyways have to fetch all items, we can as well purge all items.
* compare revisions and emit change notifications if necessary in itemsFetched
* Still emit notifications in the monitor for modifications only
Only buffer a collection after the refcount reaches zero.
Before, a collection that was dereffe'd at least once would
already be buffered (although the refcount is still >0), resulting in
the buffer being occupied by reffe'd collections (which is pointless).