Fix incorrect visibility in Attach to Process when the filter is changed.
commitb68adf2b7f8b11295374c8df6c1747c9b349eeb5
authorJohannes Sixt <j6t@kdbg.org>
Sat, 5 Jun 2010 21:31:32 +0000 (5 23:31 +0200)
committerJohannes Sixt <j6t@kdbg.org>
Sat, 5 Jun 2010 21:31:32 +0000 (5 23:31 +0200)
treef30b7a917e336457300708997236b2028004423f
parentf410659ee71c5aba6403a23ecc38b40e832066aa
Fix incorrect visibility in Attach to Process when the filter is changed.

Previously, when the text in the filter edit box was changed such that more
processes should be visible, a seemingly random set of processes remained
visible that did not match the filter. This was obviously due to
Q[3]ListViewItem::setVisible(true), which not only makes the item itself
visible, but also makes all its child items visible (not recursively,
though). This would cancel all setVisible(false) calls that were made
on each level before the first setVisible(true) call.

To fix this, we call setVisible(true) before the search descends to the
child items (because it does not hurt that all child items become visible
implicitly), and then call only setVisible(false) when it was determined
after the recursion that the item must be invisible.

On Linux, the process hierarchy actually has two roots: init for the
user-space processes, and kthreadd for kernel threads. Previously, the code
assumed that there is always only one root. This restriction is lifted so
that the filter algorithm can also hide kernel threads that do not match
the filter.
kdbg/procattach.cpp