mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-23 16:31:28 -05:00
Move search into separate class.
This commit is contained in:
parent
e361b0dd81
commit
8bf4826003
11 changed files with 264 additions and 129 deletions
|
|
@ -612,33 +612,6 @@ void Group::recCreateDelObjects()
|
|||
}
|
||||
}
|
||||
|
||||
QList<Entry*> Group::search(const QString& searchTerm, Qt::CaseSensitivity caseSensitivity,
|
||||
bool resolveInherit)
|
||||
{
|
||||
QList<Entry*> searchResult;
|
||||
bool search;
|
||||
if (resolveInherit) {
|
||||
search = resolveSearchingEnabled();
|
||||
}
|
||||
else if (searchingEnabled() == Disable) {
|
||||
search = false;
|
||||
}
|
||||
else {
|
||||
search = true;
|
||||
}
|
||||
if (search) {
|
||||
Q_FOREACH (Entry* entry, m_entries) {
|
||||
if (entry->match(searchTerm, caseSensitivity)) {
|
||||
searchResult.append(entry);
|
||||
}
|
||||
}
|
||||
Q_FOREACH (Group* group, m_children) {
|
||||
searchResult.append(group->search(searchTerm, caseSensitivity, false));
|
||||
}
|
||||
}
|
||||
return searchResult;
|
||||
}
|
||||
|
||||
bool Group::resolveSearchingEnabled() const
|
||||
{
|
||||
switch (m_data.searchingEnabled) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue