Clang: Make ClangAssistProposalModel members private

Change-Id: Ib8089f4afdb72840d97e5286d8be631387e4d2c5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-06-17 17:15:06 +02:00
parent ed27414f48
commit 5467fc25ea
3 changed files with 11 additions and 2 deletions

View File

@@ -37,13 +37,12 @@ namespace Internal {
ClangAssistProposal::ClangAssistProposal(int cursorPos, TextEditor::GenericProposalModel *model) ClangAssistProposal::ClangAssistProposal(int cursorPos, TextEditor::GenericProposalModel *model)
: GenericProposal(cursorPos, model) : GenericProposal(cursorPos, model)
, m_replaceDotForArrow(static_cast<ClangAssistProposalModel *>(model)->m_replaceDotForArrow)
{ {
} }
bool ClangAssistProposal::isCorrective() const bool ClangAssistProposal::isCorrective() const
{ {
return m_replaceDotForArrow; return ClangAssistProposalModel::replaceDotForArrow(model());
} }
void ClangAssistProposal::makeCorrection(TextEditor::TextEditorWidget *editorWidget) void ClangAssistProposal::makeCorrection(TextEditor::TextEditorWidget *editorWidget)

View File

@@ -44,6 +44,13 @@ const ClangAssistProposalItem &toClangAssistProposalItem(TextEditor::AssistPropo
} }
bool ClangAssistProposalModel::replaceDotForArrow(TextEditor::IAssistProposalModel *model)
{
auto clangAssistProposalModel = static_cast<ClangAssistProposalModel*>(model);
return clangAssistProposalModel->m_replaceDotForArrow;
}
bool ClangAssistProposalModel::isSortable(const QString &/*prefix*/) const bool ClangAssistProposalModel::isSortable(const QString &/*prefix*/) const
{ {
return true; return true;

View File

@@ -49,6 +49,9 @@ public:
bool isSortable(const QString &prefix) const override; bool isSortable(const QString &prefix) const override;
static bool replaceDotForArrow(IAssistProposalModel *model);
private:
bool m_sortable; bool m_sortable;
unsigned m_completionOperator; unsigned m_completionOperator;
bool m_replaceDotForArrow; bool m_replaceDotForArrow;