From 0b7ba197751ea6ba57db1f9ec116dd791c3b53b7 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 29 May 2020 08:26:38 +0200 Subject: fulltext: remember original query So far, the fulltext-query structure only saves an canonicalized upper-cased version of the query. However, if we want to save the fulltext query to the log (filter presets) or want to restore an old fulltext query, we have to store the original query. We don't want to confront the user with the mangled upper-cased version. Therefore, also save the original version. Signed-off-by: Berthold Stoeger --- core/fulltext.cpp | 1 + core/fulltext.h | 1 + 2 files changed, 2 insertions(+) (limited to 'core') diff --git a/core/fulltext.cpp b/core/fulltext.cpp index 9dc6d826c..38afb0798 100644 --- a/core/fulltext.cpp +++ b/core/fulltext.cpp @@ -278,6 +278,7 @@ FullTextResult FullText::find(const FullTextQuery &q, StringFilterMode mode) con FullTextQuery &FullTextQuery::operator=(const QString &s) { + originalQuery = s; words.clear(); tokenize(s, words); return *this; diff --git a/core/fulltext.h b/core/fulltext.h index 108749e1d..2f1c63db1 100644 --- a/core/fulltext.h +++ b/core/fulltext.h @@ -45,6 +45,7 @@ enum class StringFilterMode { // A fulltext query. Basically a list of normalized words we search for struct FullTextQuery { std::vector words; + QString originalQuery; // Remember original query, which will be written to the log FullTextQuery &operator=(const QString &); // Initialize by assigning a user-provided search string bool doit() const; // true if we should to a fulltext search }; -- cgit v1.2.3-70-g09d2