Rename Group::includeInSearch() to resolveSearchingEnabled().

Make it public and drop the resolveInherit parameter.
This commit is contained in:
Felix Geyer 2014-04-26 18:27:52 +02:00
parent ad26d962dc
commit 7893a2e84d
2 changed files with 14 additions and 9 deletions

View File

@ -616,7 +616,17 @@ QList<Entry*> Group::search(const QString& searchTerm, Qt::CaseSensitivity caseS
bool resolveInherit)
{
QList<Entry*> searchResult;
if (includeInSearch(resolveInherit)) {
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);
@ -629,7 +639,7 @@ QList<Entry*> Group::search(const QString& searchTerm, Qt::CaseSensitivity caseS
return searchResult;
}
bool Group::includeInSearch(bool resolveInherit)
bool Group::resolveSearchingEnabled() const
{
switch (m_data.searchingEnabled) {
case Inherit:
@ -637,12 +647,7 @@ bool Group::includeInSearch(bool resolveInherit)
return true;
}
else {
if (resolveInherit) {
return m_parent->includeInSearch(true);
}
else {
return true;
}
return m_parent->resolveSearchingEnabled();
}
case Enable:
return true;

View File

@ -65,6 +65,7 @@ public:
QString defaultAutoTypeSequence() const;
Group::TriState autoTypeEnabled() const;
Group::TriState searchingEnabled() const;
bool resolveSearchingEnabled() const;
Entry* lastTopVisibleEntry() const;
bool isExpired() const;
@ -147,7 +148,6 @@ private:
void cleanupParent();
void recCreateDelObjects();
void updateTimeinfo();
bool includeInSearch(bool resolveInherit);
QPointer<Database> m_db;
Uuid m_uuid;