Bug 204787 - [PATCH] Support regular expressions and case sensitivity in TOC search input
Summary: [PATCH] Support regular expressions and case sensitivity in TOC search input
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-22 18:22 UTC by Elvis Stansvik
Modified: 2009-10-15 22:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Support regular expressions and case sensitivity in TOC search input (5.80 KB, patch)
2009-08-22 18:23 UTC, Elvis Stansvik
Details
Screenshot (401.91 KB, image/png)
2009-08-22 18:24 UTC, Elvis Stansvik
Details
Support regular expressions and case sensitivity in TOC search input - Second patch (12.49 KB, patch)
2009-09-01 11:54 UTC, Elvis Stansvik
Details
Support regular expressions and case sensitivity in TOC search input - Third patch (12.48 KB, patch)
2009-09-01 12:01 UTC, Elvis Stansvik
Details
Support regular expressions and case sensitivity in TOC search input - Fourth patch (12.37 KB, patch)
2009-10-06 19:58 UTC, Elvis Stansvik
Details

Note You need to log in before you can comment on or make changes to this bug.
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