[Kde-pim] Review Request 122321: FavoriteCollectionsModel: avoid calling reference() all the time
David Faure
faure at kde.org
Sun Mar 1 18:05:20 GMT 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122321/#review76822
-----------------------------------------------------------
Maybe it would simpler to just do the reference stuff inside select and deselect?
- David Faure
On Jan. 29, 2015, 11:26 p.m., David Faure wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122321/
> -----------------------------------------------------------
>
> (Updated Jan. 29, 2015, 11:26 p.m.)
>
>
> Review request for KDEPIM-Libraries and Christian Mollekopf.
>
>
> 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.
>
>
> Diffs
> -----
>
> akonadi/favoritecollectionsmodel.cpp d5414b941bf838d0353dc7c6bf67302d06872ec9
>
> 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