[Kde-pim] Review Request 122321: FavoriteCollectionsModel: avoid calling reference() all the time

David Faure faure at kde.org
Mon Mar 23 17:55:06 GMT 2015


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

(Updated March 23, 2015, 5:55 p.m.)


Status
------

This change has been marked as submitted.


Review request for KDEPIM-Libraries and Christian Mollekopf.


Changes
-------

Submitted with commit 6799a4e29fffc87ca468da7257804db1ca9494cc by David Faure to branch KDE/4.14.


Repository: kdepimlibs


Description
-------

For some reason I have some non-existing collection IDs in my config
for favorites, so every call to reload() calls insertIfAvailable(dead_id)
which called reference(dead_id), ending up in EntityTreeModelPrivate::indexForCollection
where quite some iteration and linear searching happens.

=> only reference() if we were actually able to select(), i.e.
if the collection was found.
This cuts by half the number of calls to indexForCollection, at least.

REVIEW: 122321


Diffs
-----

  akonadi/favoritecollectionsmodel.cpp 234fff5a57755a7b9001695aad40b9d417bc16f7 

Diff: https://git.reviewboard.kde.org/r/122321/diff/


Testing
-------

Running kmail, with debug output in select and reference, and in deselect and dereference. In my tests (including adding/removing a favorite) everything was called correctly.


Thanks,

David Faure

_______________________________________________
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