diff --git a/src/plugins/clangcodemodel/clangassistproposalmodel.cpp b/src/plugins/clangcodemodel/clangassistproposalmodel.cpp index 6e535fb04a7..9f682ff6eb3 100644 --- a/src/plugins/clangcodemodel/clangassistproposalmodel.cpp +++ b/src/plugins/clangcodemodel/clangassistproposalmodel.cpp @@ -52,9 +52,9 @@ void ClangAssistProposalModel::sort(const QString &/*prefix*/) auto currentItemsCompare = [](AssistProposalItemInterface *first, AssistProposalItemInterface *second) { - if (first->prefixMatch() != second->prefixMatch()) { - return static_cast(first->prefixMatch()) - < static_cast(second->prefixMatch()); + if (first->proposalMatch() != second->proposalMatch()) { + return static_cast(first->proposalMatch()) + < static_cast(second->proposalMatch()); } return false; }; diff --git a/src/plugins/texteditor/codeassist/assistproposaliteminterface.h b/src/plugins/texteditor/codeassist/assistproposaliteminterface.h index 3124b46197c..d4b7f3268e9 100644 --- a/src/plugins/texteditor/codeassist/assistproposaliteminterface.h +++ b/src/plugins/texteditor/codeassist/assistproposaliteminterface.h @@ -42,7 +42,7 @@ class TEXTEDITOR_EXPORT AssistProposalItemInterface { public: // We compare proposals by enum values, be careful changing their values - enum class PrefixMatch + enum class ProposalMatch { Full = 0, Exact = 1, @@ -71,12 +71,12 @@ public: inline int order() const { return m_order; } inline void setOrder(int order) { m_order = order; } - inline PrefixMatch prefixMatch() { return m_prefixMatch; } - inline void setPrefixMatch(PrefixMatch match) { m_prefixMatch = match; } + inline ProposalMatch proposalMatch() { return m_proposalMatch; } + inline void setProposalMatch(ProposalMatch match) { m_proposalMatch = match; } private: int m_order = 0; - PrefixMatch m_prefixMatch = PrefixMatch::None; + ProposalMatch m_proposalMatch = ProposalMatch::None; }; } // namespace TextEditor diff --git a/src/plugins/texteditor/codeassist/genericproposalmodel.cpp b/src/plugins/texteditor/codeassist/genericproposalmodel.cpp index 88b7681ae09..75dcf2d540b 100644 --- a/src/plugins/texteditor/codeassist/genericproposalmodel.cpp +++ b/src/plugins/texteditor/codeassist/genericproposalmodel.cpp @@ -307,16 +307,16 @@ void GenericProposalModel::filter(const QString &prefix) m_currentItems.append(item); if (text.startsWith(prefix)) { // Direct match - item->setPrefixMatch(text.length() == prefix.length() - ? AssistProposalItemInterface::PrefixMatch::Full - : AssistProposalItemInterface::PrefixMatch::Exact); + item->setProposalMatch(text.length() == prefix.length() + ? AssistProposalItemInterface::ProposalMatch::Full + : AssistProposalItemInterface::ProposalMatch::Exact); continue; } if (text.startsWith(lowerPrefix, Qt::CaseInsensitive)) - item->setPrefixMatch(AssistProposalItemInterface::PrefixMatch::Prefix); + item->setProposalMatch(AssistProposalItemInterface::ProposalMatch::Prefix); else if (text.contains(lowerPrefix, Qt::CaseInsensitive)) - item->setPrefixMatch(AssistProposalItemInterface::PrefixMatch::Infix); + item->setProposalMatch(AssistProposalItemInterface::ProposalMatch::Infix); } } }