Review Request: Find list items by typing their initial letters.

Frank Reininghaus frank78ac at googlemail.com
Sun Aug 28 11:15:22 BST 2011


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


Looks very good from my point of view. The new files kitemlistkeyboardsearchmanager* seem to be missing in the diff though?

I think we should unit-test at least the new code in KFileItemModel, but I can take care of that later on (or we can do it together). The KItemListController code is worth unit-testing as well, but that class doesn't have a real testing infrastructure yet.


dolphin/src/kitemviews/kitemlistcontroller.h
<http://git.reviewboard.kde.org/r/102465/#comment5374>

    In general, one should avoid bool arguments unless the name of the function clearly tells what the argument is about (http://doc.qt.nokia.com/qq/qq13-apis.html#thebooleanparametertrap), but I think it's fine here because that slot is not going to be used outside this class, and making it an enum would require some more code.



dolphin/src/kitemviews/kitemlistcontroller.cpp
<http://git.reviewboard.kde.org/r/102465/#comment5373>

    When I first looked at the patch, I wondered if it will work in the case that the last item is active and searchFromNextItem == true:
    
    "currentIndex + 1" will be an invalid index then. Looking at the code in KFileItemModel showed me that it will work nonetheless, but I would change "currentIndex + 1" to "(currentIndex + 1) % m_model->count()" anyway.
    
    That's just a matter of taste though, other people may have other opinions on this matter.


- Frank


On Aug. 27, 2011, 11:22 p.m., Tirtha Chatterjee wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/102465/
> -----------------------------------------------------------
> 
> (Updated Aug. 27, 2011, 11:22 p.m.)
> 
> 
> Review request for KDE Base Apps and Peter Penz.
> 
> 
> Summary
> -------
> 
> This patch allows finding items by typing on the keyboard while the KItemListController is in focus. Timer and key queuing is handled by KItemListKeyboardManager, and search itself is done by reimplementing indexForKeyboardSearch(QString) from KItemModelBase. This implementation does not, at the moment, take care of the repetitive typing as suggested by Frank. I think we can implement that once this is in.
> 
> p.s. Not sure if line 213 in kitemlistcontroller.cpp is the best way to do it. Returning true does not work.
> p.s. I feel the name KItemListKeyboardManager can be changed to KItemListKeyboardSearchManager, although a little too big.
> 
> 
> Diffs
> -----
> 
>   dolphin/src/CMakeLists.txt 31d3f89 
>   dolphin/src/kitemviews/kfileitemmodel.h 654c7db 
>   dolphin/src/kitemviews/kfileitemmodel.cpp f36ab83 
>   dolphin/src/kitemviews/kitemlistcontroller.h 134e116 
>   dolphin/src/kitemviews/kitemlistcontroller.cpp 2e32880 
>   dolphin/src/kitemviews/kitemmodelbase.h 4670469 
>   dolphin/src/kitemviews/kitemmodelbase.cpp fc604e7 
> 
> Diff: http://git.reviewboard.kde.org/r/102465/diff
> 
> 
> Testing
> -------
> 
> yes. tested and works.
> 
> 
> Thanks,
> 
> Tirtha
> 
>

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


More information about the kde-core-devel mailing list