[Psi-Devel] [Patch] ContactView Filter
Bernhard Tittelbach
xro-psi at nurfuerspam.de
Mon Jul 30 08:01:04 PDT 2007
Remko Tronçon wrote:
>> * Filtering takes now longer if show offline was not set
>
> Why ?
Because two operations happen sequentially which can't be combined to
save time:
* Add/Insert all offline contacts to the contact list (i.e. toggle
showOffline)
* Go through list and set invisible (not remove!) all contacts not
matching the filter
as for why "showOffline" takes so much time, I believe you have already
answered that much better than I could at the moment :)
I choose to make contacts invisible instead of removing them from the
list, because it is
a) very fast
b) doesn't interfere with the other contact list operations
c) complements the other contact list operations
but in the above case its a small drawback.
>
>> Flat Roster, without groups, and sorted by Status, is whats needed.
>> That will however take some work. Maybe I will have a look at it some
>> day or maybe somebody else will be faster :)
>
> Don't invest time in that, the roster will be rewritten from scratch.
> A 'temporary' solution for the current roster is handy, but it doesn't
> need to be perfect.
>
>> On a sidenote: the patch as it is right now only filters groups and
>> contacts inside groups, but thats easily changed when it becomes an issue.
>
> What do you mean by that? What does 'filter groups' imply?
It means I look for ContactViewItems with Type "Group" and then call
filterGroup(..) on them:
+ readable code
+ reusable code
+ good way to efficently hide(make invisible) groups if it doesn't
contain contacts that match the filter. This has to be done after
checking its children, because as soon as a ContactViewItem of type
group is set to visible, all its children will become visible too.
- contacts not in a group (currently the "SelfContact") aren't filtered
- filtering won't work right now if groups were to be switched off
greetz,
Bernhard
More information about the Psi-Devel
mailing list