mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-02 06:36:07 -04:00
Move match method out of entry class.
This commit is contained in:
parent
c90ac914bb
commit
819cfd459a
4 changed files with 25 additions and 26 deletions
|
@ -579,25 +579,6 @@ const Database* Entry::database() const
|
|||
}
|
||||
}
|
||||
|
||||
bool Entry::match(const QString& searchTerm, Qt::CaseSensitivity caseSensitivity)
|
||||
{
|
||||
QStringList wordList = searchTerm.split(QRegExp("\\s"), QString::SkipEmptyParts);
|
||||
Q_FOREACH (const QString& word, wordList) {
|
||||
if (!wordMatch(word, caseSensitivity)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Entry::wordMatch(const QString& word, Qt::CaseSensitivity caseSensitivity)
|
||||
{
|
||||
return title().contains(word, caseSensitivity) ||
|
||||
username().contains(word, caseSensitivity) ||
|
||||
url().contains(word, caseSensitivity) ||
|
||||
notes().contains(word, caseSensitivity);
|
||||
}
|
||||
|
||||
QString Entry::resolvePlaceholders(const QString& str) const
|
||||
{
|
||||
QString result = str;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue