[Kde-pim] Review Request 113680: ETM refcounting fixes

Christian Mollekopf chrigi_1 at fastmail.fm
Fri Nov 15 14:51:37 GMT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/113680/
-----------------------------------------------------------

(Updated Nov. 15, 2013, 2:51 p.m.)


Review request for KDEPIM-Libraries, Dan Vrátil, Stephen Kelly, and Volker Krause.


Changes
-------

Rebased on master


Repository: kdepimlibs


Description
-------

This review contains 4 different patches since I seem to be unable to upload patches that depend on each other. Sorry about that, but it should still be reviewable. You can also find the commits in git at git.kde.org:clones/kdepimlibs/cmollekopf/kdepimlibs dev/refcounting.


Together they should fix http://bugs.kde.org/show_bug.cgi?id=312460, as well as the buffering of reference counted collections.
=> Makes reference counting work as it should.

I already uploaded a diff separately for the first patch (that is included here as well), that just fixes 312460, but not the other related problems.

-----

Simplify logic by using isMonitored consequently.

-----

Only buffer a collection after the refcount reaches zero.

Before a collection that was dereffe'd at least once
(althouh the refcount is still >0), would already be buffered, resulting in
the buffer being occupied by reffe'd collections (which is pointless).

-----

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.

Alternatives:
* compare revisions and emit change notifications if necessary in itemsFetched
* Still emit notifications in the monitor for modifications only

-----

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.


Diffs (updated)
-----

  akonadi/entitytreemodel_p.cpp d705f53aa73aa94c32854f5cbea78707533d9a9b 
  akonadi/monitor_p.h 1a1c983954b6b3f9e50c04336cf0147a5d943891 
  akonadi/monitor_p.cpp fef3eab35f72374e33b4ac248c3c555c7bd7f026 
  akonadi/tests/CMakeLists.txt 782b2b0b5857c4e4e25e1a9f091cfc03b4401890 
  akonadi/tests/lazypopulationtest.cpp PRE-CREATION 

Diff: http://git.reviewboard.kde.org/r/113680/diff/


Testing
-------

Tested manually, I'll follow up with unittests.


Thanks,

Christian Mollekopf

_______________________________________________
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