Review Request: KListWidgetSearchLine: filter items that are inserted or changed

David Faure faure at kde.org
Mon Feb 21 20:35:36 GMT 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/100709/#review1566
-----------------------------------------------------------

Ship it!


Looks good -- obviously, since it provides a unit-test ;-)
I was assuming this class handled such cases already, obviously not...

Its companion KTreeWidgetSearchLine seems to handle rowsInserted already, but not dataChanged...


kdeui/itemviews/klistwidgetsearchline.cpp
<http://git.reviewboard.kde.org/r/100709/#comment1352>

    Use .isValid() instead; faster.



kdeui/itemviews/klistwidgetsearchline.cpp
<http://git.reviewboard.kde.org/r/100709/#comment1353>

    topLeft.parent().isValid() || bottomRight.parent().isValid()


- David


On Feb. 21, 2011, 7:09 p.m., Frank Reininghaus wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/100709/
> -----------------------------------------------------------
> 
> (Updated Feb. 21, 2011, 7:09 p.m.)
> 
> 
> Review request for kdelibs and David Faure.
> 
> 
> Summary
> -------
> 
> Up to now, KlistWidgetSearchLine filters the list widget's items only when the text in the search line is changed (or updateSearch() is called directly). I propose to also update the search when items are added to the list widget or when an item's data are changed.
> 
> I've moved the actual filtering code from KListWidgetSearchLine::updateSearch(const QString &s) to a private method to avoid code duplication (basically, the same code is needed if items are added or changed).
> 
> This is needed fix bug 265709. Unit test included.
> 
> If this patch is accepted, I'll try to do something similar for KTreeWidgetSearchLine.
> 
> 
> This addresses bug 265709.
>     http://bugs.kde.org/show_bug.cgi?id=265709
> 
> 
> Diffs
> -----
> 
>   kdeui/itemviews/klistwidgetsearchline.h a78fb9b 
>   kdeui/itemviews/klistwidgetsearchline.cpp 5b9b03d 
>   kdeui/tests/CMakeLists.txt 71c2426 
>   kdeui/tests/klistwidgetsearchlinetest.cpp PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/100709/diff
> 
> 
> Testing
> -------
> 
> The bug seems fixed, the new unit test passed. I haven't observed any regressions so far.
> 
> 
> Thanks,
> 
> Frank
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110221/a3c6a807/attachment.htm>


More information about the kde-core-devel mailing list