Add an option to EntrySearcher to skip protected attributes

This commit is contained in:
Aetf
2020-01-24 12:42:00 -05:00
parent b849fdead5
commit a1f599c7c4
5 changed files with 74 additions and 19 deletions

View File

@@ -51,7 +51,7 @@ public:
bool exclude;
};
explicit EntrySearcher(bool caseSensitive = false);
explicit EntrySearcher(bool caseSensitive = false, bool skipProtected = false);
QList<Entry*> search(const QList<SearchTerm>& searchTerms, const Group* baseGroup, bool forceSearch = false);
QList<Entry*> search(const QString& searchString, const Group* baseGroup, bool forceSearch = false);
@@ -62,13 +62,14 @@ public:
QList<Entry*> repeatEntries(const QList<Entry*>& entries);
void setCaseSensitive(bool state);
bool isCaseSensitive();
bool isCaseSensitive() const;
private:
bool searchEntryImpl(const Entry* entry);
void parseSearchTerms(const QString& searchString);
bool m_caseSensitive;
bool m_skipProtected;
QRegularExpression m_termParser;
QList<SearchTerm> m_searchTerms;