Commit 91def5a8 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

CodeAssistant: Replace virtual with QTC_OVERRIDE

Change-Id: I18ea4ea410ac811972447e9395f2eef76bda8084
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
parent d087d0b6
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
#include <cplusplus/LookupContext.h> #include <cplusplus/LookupContext.h>
#include <utils/qtcoverride.h>
namespace CppTools { namespace CppTools {
class CppRefactoringFile; class CppRefactoringFile;
typedef QSharedPointer<CppRefactoringFile> CppRefactoringFilePtr; typedef QSharedPointer<CppRefactoringFile> CppRefactoringFilePtr;
...@@ -77,7 +79,7 @@ class CppQuickFixAssistProcessor : public TextEditor::QuickFixAssistProcessor ...@@ -77,7 +79,7 @@ class CppQuickFixAssistProcessor : public TextEditor::QuickFixAssistProcessor
public: public:
CppQuickFixAssistProcessor(const TextEditor::IAssistProvider *provider); CppQuickFixAssistProcessor(const TextEditor::IAssistProvider *provider);
virtual const TextEditor::IAssistProvider *provider() const; const TextEditor::IAssistProvider *provider() const QTC_OVERRIDE;
private: private:
const TextEditor::IAssistProvider *m_provider; const TextEditor::IAssistProvider *m_provider;
...@@ -86,11 +88,11 @@ private: ...@@ -86,11 +88,11 @@ private:
class CppQuickFixAssistProvider : public TextEditor::QuickFixAssistProvider class CppQuickFixAssistProvider : public TextEditor::QuickFixAssistProvider
{ {
public: public:
virtual bool isAsynchronous() const; bool isAsynchronous() const QTC_OVERRIDE;
virtual bool supportsEditor(const Core::Id &editorId) const; bool supportsEditor(const Core::Id &editorId) const QTC_OVERRIDE;
virtual TextEditor::IAssistProcessor *createProcessor() const; TextEditor::IAssistProcessor *createProcessor() const QTC_OVERRIDE;
virtual QList<TextEditor::QuickFixFactory *> quickFixFactories() const; QList<TextEditor::QuickFixFactory *> quickFixFactories() const QTC_OVERRIDE;
}; };
} // Internal } // Internal
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include <texteditor/texteditorconstants.h> #include <texteditor/texteditorconstants.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcoverride.h>
using namespace CPlusPlus; using namespace CPlusPlus;
using namespace CppEditor::Internal; using namespace CppEditor::Internal;
...@@ -88,7 +89,7 @@ protected: ...@@ -88,7 +89,7 @@ protected:
return GenericProposalWidget::eventFilter(o, e); return GenericProposalWidget::eventFilter(o, e);
} }
void showProposal(const QString &prefix) void showProposal(const QString &prefix) QTC_OVERRIDE
{ {
IGenericProposalModel *proposalModel = model(); IGenericProposalModel *proposalModel = model();
if (proposalModel && proposalModel->size() == 1) { if (proposalModel && proposalModel->size() == 1) {
...@@ -111,9 +112,9 @@ public: ...@@ -111,9 +112,9 @@ public:
, m_openInSplit(openInSplit) , m_openInSplit(openInSplit)
{} {}
bool isFragile() const { return true; } bool isFragile() const QTC_OVERRIDE { return true; }
IAssistProposalWidget *createWidget() const IAssistProposalWidget *createWidget() const QTC_OVERRIDE
{ return new VirtualFunctionProposalWidget(m_openInSplit); } { return new VirtualFunctionProposalWidget(m_openInSplit); }
private: private:
...@@ -127,7 +128,7 @@ public: ...@@ -127,7 +128,7 @@ public:
: m_params(params) : m_params(params)
{} {}
IAssistProposal *immediateProposal(const TextEditor::IAssistInterface *) IAssistProposal *immediateProposal(const TextEditor::IAssistInterface *) QTC_OVERRIDE
{ {
QTC_ASSERT(m_params.function, return 0); QTC_ASSERT(m_params.function, return 0);
...@@ -144,7 +145,7 @@ public: ...@@ -144,7 +145,7 @@ public:
m_params.openInNextSplit); m_params.openInNextSplit);
} }
IAssistProposal *perform(const IAssistInterface *) IAssistProposal *perform(const IAssistInterface *) QTC_OVERRIDE
{ {
QTC_ASSERT(m_params.function, return 0); QTC_ASSERT(m_params.function, return 0);
QTC_ASSERT(m_params.staticClass, return 0); QTC_ASSERT(m_params.staticClass, return 0);
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
#include <cplusplus/Symbols.h> #include <cplusplus/Symbols.h>
#include <cplusplus/TypeOfExpression.h> #include <cplusplus/TypeOfExpression.h>
#include <utils/qtcoverride.h>
#include <QSharedPointer> #include <QSharedPointer>
#include <QTextCursor> #include <QTextCursor>
...@@ -62,9 +64,9 @@ public: ...@@ -62,9 +64,9 @@ public:
Parameters params() const { return m_params; } Parameters params() const { return m_params; }
void clearParams() { m_params = Parameters(); } void clearParams() { m_params = Parameters(); }
bool isAsynchronous() const; bool isAsynchronous() const QTC_OVERRIDE;
bool supportsEditor(const Core::Id &editorId) const; bool supportsEditor(const Core::Id &editorId) const QTC_OVERRIDE;
TextEditor::IAssistProcessor *createProcessor() const; TextEditor::IAssistProcessor *createProcessor() const QTC_OVERRIDE;
private: private:
Parameters m_params; Parameters m_params;
......
...@@ -107,7 +107,7 @@ public: ...@@ -107,7 +107,7 @@ public:
// Invoke the processor already here to calculate the proposals. Return false in order to // Invoke the processor already here to calculate the proposals. Return false in order to
// indicate that configure failed, so the actual code assist invocation leading to a pop-up // indicate that configure failed, so the actual code assist invocation leading to a pop-up
// will not happen. // will not happen.
bool configure(const VirtualFunctionAssistProvider::Parameters &params) bool configure(const VirtualFunctionAssistProvider::Parameters &params) QTC_OVERRIDE
{ {
VirtualFunctionAssistProvider::configure(params); VirtualFunctionAssistProvider::configure(params);
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <texteditor/completionsettings.h> #include <texteditor/completionsettings.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcoverride.h>
#include <cplusplus/BackwardsScanner.h> #include <cplusplus/BackwardsScanner.h>
#include <cplusplus/CppRewriter.h> #include <cplusplus/CppRewriter.h>
...@@ -85,9 +86,9 @@ public: ...@@ -85,9 +86,9 @@ public:
CppAssistProposalItem() : CppAssistProposalItem() :
m_isOverloaded(false) {} m_isOverloaded(false) {}
virtual bool prematurelyApplies(const QChar &c) const; bool prematurelyApplies(const QChar &c) const QTC_OVERRIDE;
virtual void applyContextualContent(TextEditor::BaseTextEditor *editor, void applyContextualContent(TextEditor::BaseTextEditor *editor,
int basePosition) const; int basePosition) const QTC_OVERRIDE;
bool isOverloaded() const { return m_isOverloaded; } bool isOverloaded() const { return m_isOverloaded; }
void markAsOverloaded() { m_isOverloaded = true; } void markAsOverloaded() { m_isOverloaded = true; }
...@@ -350,10 +351,10 @@ public: ...@@ -350,10 +351,10 @@ public:
, m_typeOfExpression(typeOfExp) , m_typeOfExpression(typeOfExp)
{} {}
virtual void reset() {} void reset() QTC_OVERRIDE {}
virtual int size() const { return m_functionSymbols.size(); } int size() const QTC_OVERRIDE { return m_functionSymbols.size(); }
virtual QString text(int index) const; QString text(int index) const QTC_OVERRIDE;
virtual int activeArgument(const QString &prefix) const; int activeArgument(const QString &prefix) const QTC_OVERRIDE;
private: private:
QList<Function *> m_functionSymbols; QList<Function *> m_functionSymbols;
...@@ -452,8 +453,8 @@ public: ...@@ -452,8 +453,8 @@ public:
, m_replaceDotForArrow(static_cast<CppAssistProposalModel *>(model)->m_replaceDotForArrow) , m_replaceDotForArrow(static_cast<CppAssistProposalModel *>(model)->m_replaceDotForArrow)
{} {}
bool isCorrective() const { return m_replaceDotForArrow; } bool isCorrective() const QTC_OVERRIDE { return m_replaceDotForArrow; }
void makeCorrection(BaseTextEditor *editor); void makeCorrection(BaseTextEditor *editor) QTC_OVERRIDE;
private: private:
bool m_replaceDotForArrow; bool m_replaceDotForArrow;
...@@ -528,32 +529,32 @@ protected: ...@@ -528,32 +529,32 @@ protected:
return item; return item;
} }
virtual void visit(const Identifier *name) void visit(const Identifier *name)
{ {
_item = newCompletionItem(name); _item = newCompletionItem(name);
if (!_symbol->isScope() || _symbol->isFunction()) if (!_symbol->isScope() || _symbol->isFunction())
_item->setDetail(overview.prettyType(_symbol->type(), name)); _item->setDetail(overview.prettyType(_symbol->type(), name));
} }
virtual void visit(const TemplateNameId *name) void visit(const TemplateNameId *name)
{ {
_item = newCompletionItem(name); _item = newCompletionItem(name);
_item->setText(QLatin1String(name->identifier()->chars())); _item->setText(QLatin1String(name->identifier()->chars()));
} }
virtual void visit(const DestructorNameId *name) void visit(const DestructorNameId *name)
{ _item = newCompletionItem(name); } { _item = newCompletionItem(name); }
virtual void visit(const OperatorNameId *name) void visit(const OperatorNameId *name)
{ {
_item = newCompletionItem(name); _item = newCompletionItem(name);
_item->setDetail(overview.prettyType(_symbol->type(), name)); _item->setDetail(overview.prettyType(_symbol->type(), name));
} }
virtual void visit(const ConversionNameId *name) void visit(const ConversionNameId *name)
{ _item = newCompletionItem(name); } { _item = newCompletionItem(name); }
virtual void visit(const QualifiedNameId *name) void visit(const QualifiedNameId *name)
{ _item = newCompletionItem(name->name()); } { _item = newCompletionItem(name->name()); }
}; };
......
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#include <texteditor/codeassist/iassistprocessor.h> #include <texteditor/codeassist/iassistprocessor.h>
#include <texteditor/snippets/snippetassistcollector.h> #include <texteditor/snippets/snippetassistcollector.h>
#include <utils/qtcoverride.h>
#include <QStringList> #include <QStringList>
#include <QVariant> #include <QVariant>
...@@ -75,8 +77,8 @@ public: ...@@ -75,8 +77,8 @@ public:
m_typeOfExpression->setExpandTemplates(true); m_typeOfExpression->setExpandTemplates(true);
} }
virtual bool isSortable(const QString &prefix) const; bool isSortable(const QString &prefix) const QTC_OVERRIDE;
virtual TextEditor::IAssistProposalItem *proposalItem(int index) const; TextEditor::IAssistProposalItem *proposalItem(int index) const QTC_OVERRIDE;
unsigned m_completionOperator; unsigned m_completionOperator;
bool m_replaceDotForArrow; bool m_replaceDotForArrow;
...@@ -88,11 +90,14 @@ class InternalCompletionAssistProvider : public CppCompletionAssistProvider ...@@ -88,11 +90,14 @@ class InternalCompletionAssistProvider : public CppCompletionAssistProvider
Q_OBJECT Q_OBJECT
public: public:
virtual TextEditor::IAssistProcessor *createProcessor() const; TextEditor::IAssistProcessor *createProcessor() const QTC_OVERRIDE;
virtual TextEditor::IAssistInterface *createAssistInterface( TextEditor::IAssistInterface *createAssistInterface(
ProjectExplorer::Project *project, TextEditor::BaseTextEditor *editor, ProjectExplorer::Project *project,
QTextDocument *document, int position, TextEditor::AssistReason reason) const; TextEditor::BaseTextEditor *editor,
QTextDocument *document,
int position,
TextEditor::AssistReason reason) const QTC_OVERRIDE;
}; };
...@@ -100,9 +105,9 @@ class CppCompletionAssistProcessor : public TextEditor::IAssistProcessor ...@@ -100,9 +105,9 @@ class CppCompletionAssistProcessor : public TextEditor::IAssistProcessor
{ {
public: public:
CppCompletionAssistProcessor(); CppCompletionAssistProcessor();
virtual ~CppCompletionAssistProcessor(); ~CppCompletionAssistProcessor();
virtual TextEditor::IAssistProposal *perform(const TextEditor::IAssistInterface *interface); TextEditor::IAssistProposal *perform(const TextEditor::IAssistInterface *interface) QTC_OVERRIDE;
private: private:
TextEditor::IAssistProposal *createContentProposal(); TextEditor::IAssistProposal *createContentProposal();
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#include <texteditor/codeassist/assistenums.h> #include <texteditor/codeassist/assistenums.h>
#include <texteditor/codeassist/completionassistprovider.h> #include <texteditor/codeassist/completionassistprovider.h>
#include <utils/qtcoverride.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QTextDocument; class QTextDocument;
QT_END_NAMESPACE QT_END_NAMESPACE
...@@ -53,9 +55,9 @@ class CPPTOOLS_EXPORT CppCompletionAssistProvider : public TextEditor::Completio ...@@ -53,9 +55,9 @@ class CPPTOOLS_EXPORT CppCompletionAssistProvider : public TextEditor::Completio
Q_OBJECT Q_OBJECT
public: public:
virtual bool supportsEditor(const Core::Id &editorId) const; bool supportsEditor(const Core::Id &editorId) const QTC_OVERRIDE;
virtual int activationCharSequenceLength() const; int activationCharSequenceLength() const QTC_OVERRIDE;
virtual bool isActivationCharSequence(const QString &sequence) const; bool isActivationCharSequence(const QString &sequence) const QTC_OVERRIDE;
virtual TextEditor::IAssistInterface *createAssistInterface( virtual TextEditor::IAssistInterface *createAssistInterface(
ProjectExplorer::Project *project, TextEditor::BaseTextEditor *editor, ProjectExplorer::Project *project, TextEditor::BaseTextEditor *editor,
......
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcoverride.h>
#include <utils/savedaction.h> #include <utils/savedaction.h>
#include <utils/stylehelper.h> #include <utils/stylehelper.h>
...@@ -894,18 +895,18 @@ public: ...@@ -894,18 +895,18 @@ public:
: m_provider(const_cast<FakeVimCompletionAssistProvider *>(provider)) : m_provider(const_cast<FakeVimCompletionAssistProvider *>(provider))
{} {}
virtual bool implicitlyApplies() const bool implicitlyApplies() const QTC_OVERRIDE
{ {
return false; return false;
} }
virtual bool prematurelyApplies(const QChar &c) const bool prematurelyApplies(const QChar &c) const QTC_OVERRIDE
{ {
m_provider->appendNeedle(c); m_provider->appendNeedle(c);
return text() == m_provider->needle(); return text() == m_provider->needle();
} }
virtual void applyContextualContent(BaseTextEditor *, int) const void applyContextualContent(BaseTextEditor *, int) const QTC_OVERRIDE
{ {
QTC_ASSERT(m_provider->handler(), return); QTC_ASSERT(m_provider->handler(), return);
m_provider->handler()->handleReplay(text().mid(m_provider->needle().size())); m_provider->handler()->handleReplay(text().mid(m_provider->needle().size()));
...@@ -924,7 +925,7 @@ public: ...@@ -924,7 +925,7 @@ public:
: BasicProposalItemListModel(items) : BasicProposalItemListModel(items)
{} {}
virtual bool supportsPrefixExpansion() const bool supportsPrefixExpansion() const QTC_OVERRIDE
{ {
return false; return false;
} }
...@@ -937,7 +938,7 @@ public: ...@@ -937,7 +938,7 @@ public:
: m_provider(static_cast<const FakeVimCompletionAssistProvider *>(provider)) : m_provider(static_cast<const FakeVimCompletionAssistProvider *>(provider))
{} {}
IAssistProposal *perform(const IAssistInterface *interface) IAssistProposal *perform(const IAssistInterface *interface) QTC_OVERRIDE
{ {
const QString &needle = m_provider->needle(); const QString &needle = m_provider->needle();
...@@ -1728,7 +1729,7 @@ public: ...@@ -1728,7 +1729,7 @@ public:
: QObject(parent), m_handler(handler) : QObject(parent), m_handler(handler)
{} {}
virtual ~DeferredDeleter() ~DeferredDeleter()
{ {
if (m_handler) { if (m_handler) {
m_handler->disconnectFromEditor(); m_handler->disconnectFromEditor();
......
...@@ -46,7 +46,9 @@ ...@@ -46,7 +46,9 @@
#include <texteditor/codeassist/genericproposal.h> #include <texteditor/codeassist/genericproposal.h>
#include <texteditor/codeassist/functionhintproposal.h> #include <texteditor/codeassist/functionhintproposal.h>
#include <cplusplus/ExpressionUnderCursor.h> #include <cplusplus/ExpressionUnderCursor.h>
#include <utils/faketooltip.h> #include <utils/faketooltip.h>
#include <utils/qtcoverride.h>
#include <QIcon> #include <QIcon>
#include <QPainter> #include <QPainter>
...@@ -149,10 +151,10 @@ public: ...@@ -149,10 +151,10 @@ public:
, m_currentArg(-1) , m_currentArg(-1)
{} {}
virtual void reset() {} void reset() QTC_OVERRIDE {}
virtual int size() const { return m_items.size(); } int size() const QTC_OVERRIDE { return m_items.size(); }
virtual QString text(int index) const; QString text(int index) const QTC_OVERRIDE;
virtual int activeArgument(const QString &prefix) const; int activeArgument(const QString &prefix) const QTC_OVERRIDE;
private: private:
QVector<GLSL::Function *> m_items; QVector<GLSL::Function *> m_items;
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
#include <texteditor/codeassist/defaultassistinterface.h> #include <texteditor/codeassist/defaultassistinterface.h>
#include <texteditor/codeassist/ifunctionhintproposalmodel.h> #include <texteditor/codeassist/ifunctionhintproposalmodel.h>
#include <utils/qtcoverride.h>
#include <QScopedPointer> #include <QScopedPointer>
#include <QIcon> #include <QIcon>
...@@ -54,20 +56,20 @@ class GLSLCompletionAssistProvider : public TextEditor::CompletionAssistProvider ...@@ -54,20 +56,20 @@ class GLSLCompletionAssistProvider : public TextEditor::CompletionAssistProvider
Q_OBJECT Q_OBJECT
public: public:
virtual bool supportsEditor(const Core::Id &editorId) const; bool supportsEditor(const Core::Id &editorId) const QTC_OVERRIDE;
virtual TextEditor::IAssistProcessor *createProcessor() const; TextEditor::IAssistProcessor *createProcessor() const QTC_OVERRIDE;
virtual int activationCharSequenceLength() const; int activationCharSequenceLength() const QTC_OVERRIDE;
virtual bool isActivationCharSequence(const QString &sequence) const; bool isActivationCharSequence(const QString &sequence) const QTC_OVERRIDE;
}; };
class GLSLCompletionAssistProcessor : public TextEditor::IAssistProcessor class GLSLCompletionAssistProcessor : public TextEditor::IAssistProcessor
{ {
public: public:
GLSLCompletionAssistProcessor(); GLSLCompletionAssistProcessor();
virtual ~GLSLCompletionAssistProcessor(); ~GLSLCompletionAssistProcessor();
virtual TextEditor::IAssistProposal *perform(const TextEditor::IAssistInterface *interface); TextEditor::IAssistProposal *perform(const TextEditor::IAssistInterface *interface) QTC_OVERRIDE;
private: private:
TextEditor::IAssistProposal *createContentProposal() const; TextEditor::IAssistProposal *createContentProposal() const;
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#include <texteditor/codeassist/completionassistprovider.h> #include <texteditor/codeassist/completionassistprovider.h>
#include <utils/qtcoverride.h>
#include <QStringList> #include <QStringList>
namespace QmakeProjectManager { namespace QmakeProjectManager {
...@@ -43,10 +45,10 @@ class ProFileCompletionAssistProvider : public TextEditor::CompletionAssistProvi ...@@ -43,10 +45,10 @@ class ProFileCompletionAssistProvider : public TextEditor::CompletionAssistProvi
public: public:
ProFileCompletionAssistProvider(); ProFileCompletionAssistProvider();
void init(); void init();
virtual ~ProFileCompletionAssistProvider(); ~ProFileCompletionAssistProvider();
virtual bool supportsEditor(const Core::Id &editorId) const; bool supportsEditor(const Core::Id &editorId) const QTC_OVERRIDE;
virtual TextEditor::IAssistProcessor *createProcessor() const; TextEditor::IAssistProcessor *createProcessor() const QTC_OVERRIDE;
QStringList variables() const; QStringList variables() const;
QStringList functions() const; QStringList functions() const;
private: private:
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <texteditor/completionsettings.h> #include <texteditor/completionsettings.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcoverride.h>
#include <qmljs/qmljsmodelmanagerinterface.h> #include <qmljs/qmljsmodelmanagerinterface.h>
#include <qmljs/parser/qmljsast_p.h> #include <qmljs/parser/qmljsast_p.h>
...@@ -136,7 +137,7 @@ public: ...@@ -136,7 +137,7 @@ public:
, order(order) , order(order)
{}