[gnote] Lowercase search text on case-insensitive search



commit 60f1bd9dba8d57d912c3d323c69ff4b3ae9afd46
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 1d39439..42d7754 100644
--- a/src/search.cpp
+++ b/src/search.cpp
@@ -39,12 +39,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]