Add search.

Refs #24
This commit is contained in:
Florian Geyer 2012-05-12 13:22:41 +02:00
parent f836629dda
commit 6b6c109903
13 changed files with 224 additions and 35 deletions

View file

@ -465,8 +465,9 @@ void Entry::setGroup(Group* group)
}
}
group->addEntry(this);
m_group = group;
group->addEntry(this);
QObject::setParent(group);
if (m_updateTimeinfo) {
@ -488,3 +489,11 @@ const Database* Entry::database() const
return 0;
}
}
bool Entry::match(const QString& searchTerm, Qt::CaseSensitivity caseSensitivity)
{
return title().contains(searchTerm, caseSensitivity) ||
username().contains(searchTerm, caseSensitivity) ||
url().contains(searchTerm, caseSensitivity) ||
notes().contains(searchTerm, caseSensitivity);
}