From 7893a2e84d839ad4e90109caa2daa49f6bb7a6c5 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sat, 26 Apr 2014 18:27:52 +0200 Subject: [PATCH] Rename Group::includeInSearch() to resolveSearchingEnabled(). Make it public and drop the resolveInherit parameter. --- src/core/Group.cpp | 21 +++++++++++++-------- src/core/Group.h | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/core/Group.cpp b/src/core/Group.cpp index ada9e9723..b8a959d49 100644 --- a/src/core/Group.cpp +++ b/src/core/Group.cpp @@ -616,7 +616,17 @@ QList Group::search(const QString& searchTerm, Qt::CaseSensitivity caseS bool resolveInherit) { QList 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 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; diff --git a/src/core/Group.h b/src/core/Group.h index 558bebcc9..4e6b9bd48 100644 --- a/src/core/Group.h +++ b/src/core/Group.h @@ -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 m_db; Uuid m_uuid;