diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-05-29 08:26:38 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-09-29 16:13:03 -0700 |
commit | 0b7ba197751ea6ba57db1f9ec116dd791c3b53b7 (patch) | |
tree | 99578f3330e8477b682de019f6a724d1c7fc9641 /core | |
parent | 0f4154bacccd0884ffbd5ae5bfa1fa16991675dc (diff) | |
download | subsurface-0b7ba197751ea6ba57db1f9ec116dd791c3b53b7.tar.gz |
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r-- | core/fulltext.cpp | 1 | ||||
-rw-r--r-- | core/fulltext.h | 1 |
2 files changed, 2 insertions, 0 deletions
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<QString> 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 }; |