Streamlined searcher code

* Remove searching of group title and notes
* End search when selecting a new group
* Correct entry searcher tests to align with new code
This commit is contained in:
Jonathan White 2018-03-19 23:16:22 -04:00
parent a5e7da67d8
commit d8d758f0e1
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01
7 changed files with 39 additions and 60 deletions

View file

@ -53,7 +53,6 @@ void TestEntrySearcher::testSearch()
group2111->setParent(group211);
group1->setSearchingEnabled(Group::Disable);
group11->setSearchingEnabled(Group::Enable);
Entry* eRoot = new Entry();
eRoot->setNotes("test search term test");
@ -88,15 +87,13 @@ void TestEntrySearcher::testSearch()
e3b->setGroup(group3);
m_searchResult = m_entrySearcher.search("search term", m_groupRoot, Qt::CaseInsensitive);
QCOMPARE(m_searchResult.count(), 3);
QCOMPARE(m_searchResult.count(), 2);
m_searchResult = m_entrySearcher.search("search term", group211, Qt::CaseInsensitive);
QCOMPARE(m_searchResult.count(), 1);
// Parent group disabled search
m_searchResult = m_entrySearcher.search("search term", group11, Qt::CaseInsensitive);
QCOMPARE(m_searchResult.count(), 1);
m_searchResult = m_entrySearcher.search("search term", group1, Qt::CaseInsensitive);
QCOMPARE(m_searchResult.count(), 0);
}