klistviewsearchline

Daniel Teske teske at squorn.de
Sat Jul 2 14:26:16 BST 2005


Hi

The attached patch fixes a bug.
Steps to reproduce:
Start keditbookmarks[1]
Type into the searchline until no item matches.
Delete the last char
Notice that all items are shown.

The problem is in the algorithm.
Assume the following structure:

f1
|->i1
|->i2

and the searchline text i1a.
=> No items are visible:
Backspace the last char
=> Searchline text is now i1

checkItemParentsVisible( f1 );
 checks if any children should be visible
 or it matches:
 
 checkItemParentsVisible( i1 );
   i1 matches now, setVisible is called
   and ignored by QT (because the parent is invisble)
   returns true

 checkItemParentsVisble( i2 );
   return false;

 As a children should be visible:
 setVisible(f1);
 => QT calls setVisible() for i1 and i2.

End:
i2 is visible, but doesn't match

The patch fixes it, by making all items visible and then hiding.
I could optimize it, to make less changes to the visibility.

Is this patch okay to commit?

daniel

[1] 
Any other listview with a klistview searchline is affected too, if it 
shows a tree and uses keepParentsVisible = true (the default).
Note: I recently changed keditbookmarks to use a derived version, but 
that doesn't change the bug.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: klistviewsearchline.patch
Type: text/x-diff
Size: 1654 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050702/0b8abf9f/attachment.patch>


More information about the kde-core-devel mailing list