Bug 204787

Summary: [PATCH] Support regular expressions and case sensitivity in TOC search input
Product: [Applications] okular Reporter: Elvis Stansvik <elvstone>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Support regular expressions and case sensitivity in TOC search input
Screenshot
Support regular expressions and case sensitivity in TOC search input - Second patch
Support regular expressions and case sensitivity in TOC search input - Third patch
Support regular expressions and case sensitivity in TOC search input - Fourth patch

Description Elvis Stansvik 2009-08-22 18:22:12 UTC
Version:           r1000383 (using Devel)
Compiler:          gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3 
OS:                Linux
Installed from:    Compiled sources

Attached is a patch for review that adds a context submenu to the
search line called "Search Options" where you can enable regular
expression support and case sensitivity. Also attaching a screen shot
to show what it looks like.

If you're OK with the patch I can commit it right away. If you don't
want this feature that's OK too ;)
Comment 1 Elvis Stansvik 2009-08-22 18:23:34 UTC
Created attachment 36357 [details]
Support regular expressions and case sensitivity in TOC search input
Comment 2 Elvis Stansvik 2009-08-22 18:24:08 UTC
Created attachment 36358 [details]
Screenshot
Comment 3 Elvis Stansvik 2009-09-01 11:54:23 UTC
Created attachment 36611 [details]
Support regular expressions and case sensitivity in TOC search input - Second patch

After some input from tsdgeos on IRC yesterday, I'm attaching a new version of the patch with the following improvements:

 o Save the search options to the settings.
 o Use i18nc() instead of i18n(), to give some context to translators.
 o Add the same kind of support to the Reviews side panel, since it uses the same search line widget.

Please review and tell me if there's something else that needs fixing!
Comment 4 Elvis Stansvik 2009-09-01 12:01:21 UTC
Created attachment 36612 [details]
Support regular expressions and case sensitivity in TOC search input - Third patch

This is a slightly improved version of the previous patch; I corrected the i18nc() context message to be a bit more correct.
Comment 5 Elvis Stansvik 2009-09-14 20:27:55 UTC
tsdgeos pretty much said he thought the patch was good, but I'd love to get an OK on this one from you pino ;)
Comment 6 Elvis Stansvik 2009-10-06 19:58:28 UTC
Created attachment 37411 [details]
Support regular expressions and case sensitivity in TOC search input - Fourth patch

This is the fourth version of this patch, and includes two suggestions from Pino:

 o Use QRegExp all the time, but with PatterSyntax QRegExp::FixedString for plain text search. And construct the QRegExp object in advance, not in the loop.
 o Use QRegExp::indexIn() instead of QString::indexOf() [1].

OK to commit?

[1] http://labs.trolltech.com/blogs/2008/11/04/910/
Comment 7 Elvis Stansvik 2009-10-15 22:25:49 UTC
SVN commit 1035766 by astan:

Support case sensitivity and regular expressions in the
Contents and Reviews side panel. The search options are
accessed using a context sub-menu in the search input
field. Fixes bug 204787.

I'm intentionally leaving out support for saving the current
search options to the config, as pinotree said he was
researching a more maintainable approach to this.

BUG: 204787


 M  +56 -2     ktreeviewsearchline.cpp  
 M  +22 -0     ktreeviewsearchline.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1035766