After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 662426 - case insensitive search is not case insensitive
case insensitive search is not case insensitive
Status: RESOLVED FIXED
Product: gnote
Classification: Applications
Component: main
git master
Other Linux
: Normal normal
: ---
Assigned To: gnote-maint
gnote-maint
Depends on:
Blocks:
 
 
Reported: 2011-10-21 21:36 UTC by Casey Harkins
Modified: 2011-10-22 12:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix case insensitive searching. (1.52 KB, patch)
2011-10-21 21:36 UTC, Casey Harkins
none Details | Review

Description Casey Harkins 2011-10-21 21:36:01 UTC
Created attachment 199703 [details] [review]
Fix case insensitive searching.

Search::search_notes() has an bool argument for determining if the search should be case sensitive. This is passed along to Search::check_note_has_match() and Search::find_match_count_in_note() where the actual searching is done. When this argument (case_sensitive, or match_case) is false, the note text is converted to lower case before searching. However, the search terms should also be converted to lower case to truly make this case insensitive.

For example, with the current code and case_sensitive=false, "foo" would match both "Foo" and "foo". However, "Foo" would match neither "Foo" nor "foo".

The attached patch will also convert the search terms to lower case when appropriate.
Comment 1 Aurimas Černius 2011-10-22 12:49:53 UTC
The simpler way is to lowercase the query at the beginning of search_notes() if case_sensitive is false.

This problem has been fixed in our software repository. The fix will go into
0.7.6 and 0.8.1 releases. Thank you for your bug report.