Just a quick refresher to make sure we're on the same page...
The root node of the buddy list is a group. it has siblings of other gruops. Each group can contain chats and contacts. Chats have no children but have chats and contacts as siblings. Contacts have chats and contacts as siblings, and buddies as children.
From my understand of this patch, it looks like you are expanding contacts not groups. This would make sense because a
GtkTreeModelshould already handle searching on hidden/collapsed items.
However, we use a special cell rendered,
PidginCellRendererExpander(or something like that). This could actually be inplemented incorrectly and causing search to not find it's children so we might want to look there first, before manually iterating the tree in a function that's alread iterating the tree.
It might worth a proof of concept to see if the native search can find collapsed items.
Make collapsed groups searchable in the buddy list
Review Request #1494 — Created June 6, 2022 and submitted
Searching collapsed groups works by expanding them as they are traversed by the search function. To mitigate leaving behind expanded groups that were previously collapsed by the user, the groups that were expanded by the search are flagged as such so that they can be collapsed back automatically.
Compiled and tested with lots of groups and buddies on Linux. Also tested with nested buddies.
Nice work, thanks for seeing this through to the end!!