[gnote/stable-0.7] Lowercase search text on case-insensitive search
- From: Aurimas Äernius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote/stable-0.7] Lowercase search text on case-insensitive search
- Date: Sat, 22 Oct 2011 12:46:19 +0000 (UTC)
commit 21e9d3ba873373cfb58d852b075e29c35e0f1040
Author: Aurimas Äernius <aurisc4 gmail com>
Date: Sat Oct 22 15:31:25 2011 +0300
Lowercase search text on case-insensitive search
Affects searching using D-Bus API.
Fixes bug 662426.
src/search.cpp | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/search.cpp b/src/search.cpp
index d8c380d..e78933c 100644
--- a/src/search.cpp
+++ b/src/search.cpp
@@ -38,12 +38,17 @@ namespace gnote {
Search::ResultsPtr Search::search_notes(const std::string & query, bool case_sensitive,
const notebooks::Notebook::Ptr & selected_notebook)
{
+ std::string search_text = query;
+ if(!case_sensitive) {
+ search_text = sharp::string_to_lower(search_text);
+ }
+
std::vector<std::string> words;
- Search::split_watching_quotes(words, query);
+ Search::split_watching_quotes(words, search_text);
// Used for matching in the raw note XML
std::vector<std::string> encoded_words;
- Search::split_watching_quotes(encoded_words, utils::XmlEncoder::encode (query));
+ Search::split_watching_quotes(encoded_words, utils::XmlEncoder::encode (search_text));
ResultsPtr temp_matches(new Results);
// Skip over notes that are template notes
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]