KListViewSearchLine more intelligent matching:

Daniel Teske teske at squorn.de
Wed Mar 9 17:56:29 GMT 2005


There is a feature request to make the KListSearchLine in KEditBookmarks
better. I have produced a patch with implents the requested feature by
deriving of KListViewSearchLine
See: http://bugs.kde.org/show_bug.cgi?id=99700 (40 votes)

In addition to the requested AND matching, the patch adds a OR mode.
AND: must match all words.
OR: must match one word.

Now I need some guidance if I should add this class to kdelibs. 
If this is not useful to others, I can add it to keditbookmarks.

(Also attached is the oneliner for keditbookmark, to actually use the
new class.)

Technical details:
No changes to the base class.

The function setMode() doesn't call updateSearch(), because the base
class has the same (undocumented) behaviour for setSearchColumns(),
setCaseSensitive() and setKeepParentsVisible().

All the magic is inside KListViewAdvancedSearchLine(), just ~20 lines.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: keditbookmark.patch
Type: text/x-patch
Size: 832 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050309/81cbf914/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: klistviewsearchline.patch
Type: text/x-patch
Size: 3832 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050309/81cbf914/attachment-0001.bin>

More information about the kde-core-devel mailing list