Review Request: Delayed Search: Give the user a chance to enter the whole word before begining search

Arjen Hiemstra djfreestyler at gmail.com
Sat May 19 20:09:23 BST 2012


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


"The problem with this approach is that we use QTextDocument's find method to search the text and we cannot interrupt when this method is called(can we?)"

Well it does a little more than just QTextDocument::find(), to be precise, it loops until QTextDocument::find() has found no more matches. The loop can - and probably should - be interrupted when the search value changes. QTextDocument's find method is harder to interrupt. In the case of your example interrupting the loop would solve your problem, but most likely the case where there is one match in the entire document will still be slow. So no real objections to this addition.


libs/main/KoFindToolbar.h
<http://git.reviewboard.kde.org/r/104996/#comment11090>

    No need to include QTimer in the header, please move it to the source file.



libs/main/KoFindToolbar.cpp
<http://git.reviewboard.kde.org/r/104996/#comment11091>

    Please use a pointer to Timer instead of a direct object. QObject based classes should generally be constructed on the heap.



libs/main/KoFindToolbar.cpp
<http://git.reviewboard.kde.org/r/104996/#comment11092>

    Since you're using a single shot timer anyway, there is no need to call stop().


- Arjen Hiemstra


On May 19, 2012, 3:45 p.m., Gopalakrishna Bhat wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/104996/
> -----------------------------------------------------------
> 
> (Updated May 19, 2012, 3:45 p.m.)
> 
> 
> Review request for Calligra.
> 
> 
> Description
> -------
> 
> When we try to search for a text that is most common in a large document the ui used to hang when the first letter was entered in the search box i.e. hung until the search for the first letter in the whole document is over.
> 
> Particular scenario that I have in mind: 
> 
> 1) Open the ODF 1.2 spec document in Words
> 2) Try searching for the word "the" in the document
> 3) As soon as the letter 't' is entered in the search field the user has to wait for the search to complete before he can see the other two letters "he" appear.
> 
> As a solution to the above scenario, this patch introduces a delay of 1s after the last key has been keyed before begining the search.
> 
> 
> Diffs
> -----
> 
>   libs/main/KoFindToolbar.h 9c44694 
>   libs/main/KoFindToolbar.cpp 0199c6a 
> 
> Diff: http://git.reviewboard.kde.org/r/104996/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Gopalakrishna Bhat
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20120519/b0bd65d3/attachment.htm>


More information about the calligra-devel mailing list