[PATCH] KListViewSearchLine fix

Andras Mantia amantia at kde.org
Thu Jun 10 16:36:08 BST 2004


Hi,

 I discovered that KListViewSearchLine is buggy as it shows items that 
are not matched by the search string. The easiest way to see is to fire 
the shortcut configuration dialog in an application (take KWrite as an 
example) and type something, like ("bl"). This should match only one 
item (Block Selection), but matches the Align as well... 
 The bug is visible also in KMail, but less often as you need a thread 
with changing subjects. The "Refactoring KCM techology" (started at 
2004-03-19) from kde-core-devel is a good testing thread. Try to search 
for "khelpcenter".
 The problem is caused by QListViewItem::setVisible() which seems to set 
the visible flags for some child items as well. The following patch 
makes the hiding a lot more complicated than before as it goes through 
the list several times, until it doesn't find anything that needs to be 
removed. But it's not recursive. ;-) . For me it works in the shortcut 
dialog, but for some reason it doesn't work in KMail. Does KMail have 
it's own implementation?

Anyway, here is the patch. If you know a better way to do the same, just 
throw away. If you think that this is good, I will put in the CVS. 
Note, that I haven't changed (yet) the checkItem() signature, but now 
the argument is not needed at all. Is it safe to change the signature 
of a non-virtual private method?

Andras

-- 
Quanta Plus developer - http://quanta.sourceforge.net
K Desktop Environment - http://www.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KListViewSearchLine.diff
Type: text/x-diff
Size: 2931 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040610/2e310a84/attachment.diff>


More information about the kde-core-devel mailing list