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 @@
#include <cplusplus/LookupContext.h>
#include <utils/qtcoverride.h>
namespace CppTools {
class CppRefactoringFile;
typedef QSharedPointer<CppRefactoringFile> CppRefactoringFilePtr;
......@@ -77,7 +79,7 @@ class CppQuickFixAssistProcessor : public TextEditor::QuickFixAssistProcessor
public:
CppQuickFixAssistProcessor(const TextEditor::IAssistProvider *provider);
virtual const TextEditor::IAssistProvider *provider() const;
const TextEditor::IAssistProvider *provider() const QTC_OVERRIDE;
private:
const TextEditor::IAssistProvider *m_provider;
......@@ -86,11 +88,11 @@ private:
class CppQuickFixAssistProvider : public TextEditor::QuickFixAssistProvider
{
public:
virtual bool isAsynchronous() const;
virtual bool supportsEditor(const Core::Id &editorId) const;
virtual TextEditor::IAssistProcessor *createProcessor() const;
bool isAsynchronous() const QTC_OVERRIDE;
bool supportsEditor(const Core::Id &editorId) const QTC_OVERRIDE;
TextEditor::IAssistProcessor *createProcessor() const QTC_OVERRIDE;
virtual QList<TextEditor::QuickFixFactory *> quickFixFactories() const;
QList<TextEditor::QuickFixFactory *> quickFixFactories() const QTC_OVERRIDE;
};
} // Internal
......
......@@ -53,6 +53,7 @@
#include <texteditor/texteditorconstants.h>
#include <utils/qtcassert.h>
#include <utils/qtcoverride.h>
using namespace CPlusPlus;
using namespace CppEditor::Internal;
......@@ -88,7 +89,7 @@ protected:
return GenericProposalWidget::eventFilter(o, e);
}
void showProposal(const QString &prefix)
void showProposal(const QString &prefix) QTC_OVERRIDE
{
IGenericProposalModel *proposalModel = model();
if (proposalModel && proposalModel->size() == 1) {
......@@ -111,9 +112,9 @@ public:
, 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); }
private:
......@@ -127,7 +128,7 @@ public:
: m_params(params)
{}
IAssistProposal *immediateProposal(const TextEditor::IAssistInterface *)
IAssistProposal *immediateProposal(const TextEditor::IAssistInterface *) QTC_OVERRIDE
{
QTC_ASSERT(m_params.function, return 0);
......@@ -144,7 +145,7 @@ public:
m_params.openInNextSplit);
}
IAssistProposal *perform(const IAssistInterface *)
IAssistProposal *perform(const IAssistInterface *) QTC_OVERRIDE
{
QTC_ASSERT(m_params.function, return 0);
QTC_ASSERT(m_params.staticClass, return 0);
......
......@@ -36,6 +36,8 @@
#include <cplusplus/Symbols.h>
#include <cplusplus/TypeOfExpression.h>
#include <utils/qtcoverride.h>
#include <QSharedPointer>
#include <QTextCursor>
......@@ -62,9 +64,9 @@ public:
Parameters params() const { return m_params; }
void clearParams() { m_params = Parameters(); }
bool isAsynchronous() const;
bool supportsEditor(const Core::Id &editorId) const;
TextEditor::IAssistProcessor *createProcessor() const;
bool isAsynchronous() const QTC_OVERRIDE;
bool supportsEditor(const Core::Id &editorId) const QTC_OVERRIDE;
TextEditor::IAssistProcessor *createProcessor() const QTC_OVERRIDE;
private:
Parameters m_params;
......
......@@ -107,7 +107,7 @@ public:
// 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
// will not happen.
bool configure(const VirtualFunctionAssistProvider::Parameters &params)
bool configure(const VirtualFunctionAssistProvider::Parameters &params) QTC_OVERRIDE
{
VirtualFunctionAssistProvider::configure(params);
......
......@@ -45,6 +45,7 @@
#include <texteditor/completionsettings.h>
#include <utils/qtcassert.h>
#include <utils/qtcoverride.h>
#include <cplusplus/BackwardsScanner.h>
#include <cplusplus/CppRewriter.h>
......@@ -85,9 +86,9 @@ public:
CppAssistProposalItem() :
m_isOverloaded(false) {}
virtual bool prematurelyApplies(const QChar &c) const;
virtual void applyContextualContent(TextEditor::BaseTextEditor *editor,
int basePosition) const;
bool prematurelyApplies(const QChar &c) const QTC_OVERRIDE;
void applyContextualContent(TextEditor::BaseTextEditor *editor,
int basePosition) const QTC_OVERRIDE;
bool isOverloaded() const { return m_isOverloaded; }
void markAsOverloaded() { m_isOverloaded = true; }
......@@ -350,10 +351,10 @@ public:
, m_typeOfExpression(typeOfExp)
{}
virtual void reset() {}
virtual int size() const { return m_functionSymbols.size(); }
virtual QString text(int index) const;
virtual int activeArgument(const QString &prefix) const;
void reset() QTC_OVERRIDE {}
int size() const QTC_OVERRIDE { return m_functionSymbols.size(); }
QString text(int index) const QTC_OVERRIDE;
int activeArgument(const QString &prefix) const QTC_OVERRIDE;
private:
QList<Function *> m_functionSymbols;
......@@ -452,8 +453,8 @@ public:
, m_replaceDotForArrow(static_cast<CppAssistProposalModel *>(model)->m_replaceDotForArrow)
{}
bool isCorrective() const { return m_replaceDotForArrow; }
void makeCorrection(BaseTextEditor *editor);
bool isCorrective() const QTC_OVERRIDE { return m_replaceDotForArrow; }
void makeCorrection(BaseTextEditor *editor) QTC_OVERRIDE;
private:
bool m_replaceDotForArrow;
......@@ -528,32 +529,32 @@ protected:
return item;
}
virtual void visit(const Identifier *name)
void visit(const Identifier *name)
{
_item = newCompletionItem(name);
if (!_symbol->isScope() || _symbol->isFunction())
_item->setDetail(overview.prettyType(_symbol->type(), name));
}
virtual void visit(const TemplateNameId *name)
void visit(const TemplateNameId *name)
{
_item = newCompletionItem(name);
_item->setText(QLatin1String(name->identifier()->chars()));
}
virtual void visit(const DestructorNameId *name)
void visit(const DestructorNameId *name)
{ _item = newCompletionItem(name); }
virtual void visit(const OperatorNameId *name)
void visit(const OperatorNameId *name)
{
_item = newCompletionItem(name);
_item->setDetail(overview.prettyType(_symbol->type(), name));
}
virtual void visit(const ConversionNameId *name)
void visit(const ConversionNameId *name)
{ _item = newCompletionItem(name); }
virtual void visit(const QualifiedNameId *name)
void visit(const QualifiedNameId *name)
{ _item = newCompletionItem(name->name()); }
};
......
......@@ -44,6 +44,8 @@
#include <texteditor/codeassist/iassistprocessor.h>
#include <texteditor/snippets/snippetassistcollector.h>
#include <utils/qtcoverride.h>
#include <QStringList>
#include <QVariant>
......@@ -75,8 +77,8 @@ public:
m_typeOfExpression->setExpandTemplates(true);
}
virtual bool isSortable(const QString &prefix) const;
virtual TextEditor::IAssistProposalItem *proposalItem(int index) const;
bool isSortable(const QString &prefix) const QTC_OVERRIDE;
TextEditor::IAssistProposalItem *proposalItem(int index) const QTC_OVERRIDE;
unsigned m_completionOperator;
bool m_replaceDotForArrow;
......@@ -88,11 +90,14 @@ class InternalCompletionAssistProvider : public CppCompletionAssistProvider
Q_OBJECT
public:
virtual TextEditor::IAssistProcessor *createProcessor() const;
TextEditor::IAssistProcessor *createProcessor() const QTC_OVERRIDE;
virtual TextEditor::IAssistInterface *createAssistInterface(
ProjectExplorer::Project *project, TextEditor::BaseTextEditor *editor,
QTextDocument *document, int position, TextEditor::AssistReason reason) const;
TextEditor::IAssistInterface *createAssistInterface(
ProjectExplorer::Project *project,
TextEditor::BaseTextEditor *editor,
QTextDocument *document,
int position,
TextEditor::AssistReason reason) const QTC_OVERRIDE;
};
......@@ -100,9 +105,9 @@ class CppCompletionAssistProcessor : public TextEditor::IAssistProcessor
{
public:
CppCompletionAssistProcessor();
virtual ~CppCompletionAssistProcessor();
~CppCompletionAssistProcessor();
virtual TextEditor::IAssistProposal *perform(const TextEditor::IAssistInterface *interface);
TextEditor::IAssistProposal *perform(const TextEditor::IAssistInterface *interface) QTC_OVERRIDE;
private:
TextEditor::IAssistProposal *createContentProposal();
......
......@@ -35,6 +35,8 @@
#include <texteditor/codeassist/assistenums.h>
#include <texteditor/codeassist/completionassistprovider.h>
#include <utils/qtcoverride.h>
QT_BEGIN_NAMESPACE
class QTextDocument;
QT_END_NAMESPACE
......@@ -53,9 +55,9 @@ class CPPTOOLS_EXPORT CppCompletionAssistProvider : public TextEditor::Completio
Q_OBJECT
public:
virtual bool supportsEditor(const Core::Id &editorId) const;
virtual int activationCharSequenceLength() const;
virtual bool isActivationCharSequence(const QString &sequence) const;
bool supportsEditor(const Core::Id &editorId) const QTC_OVERRIDE;
int activationCharSequenceLength() const QTC_OVERRIDE;
bool isActivationCharSequence(const QString &sequence) const QTC_OVERRIDE;
virtual TextEditor::IAssistInterface *createAssistInterface(
ProjectExplorer::Project *project, TextEditor::BaseTextEditor *editor,
......
......@@ -73,6 +73,7 @@
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <utils/qtcoverride.h>
#include <utils/savedaction.h>
#include <utils/stylehelper.h>
......@@ -894,18 +895,18 @@ public:
: m_provider(const_cast<FakeVimCompletionAssistProvider *>(provider))
{}
virtual bool implicitlyApplies() const
bool implicitlyApplies() const QTC_OVERRIDE
{
return false;
}
virtual bool prematurelyApplies(const QChar &c) const
bool prematurelyApplies(const QChar &c) const QTC_OVERRIDE
{
m_provider->appendNeedle(c);
return text() == m_provider->needle();
}
virtual void applyContextualContent(BaseTextEditor *, int) const
void applyContextualContent(BaseTextEditor *, int) const QTC_OVERRIDE
{
QTC_ASSERT(m_provider->handler(), return);
m_provider->handler()->handleReplay(text().mid(m_provider->needle().size()));
......@@ -924,7 +925,7 @@ public:
: BasicProposalItemListModel(items)
{}
virtual bool supportsPrefixExpansion() const
bool supportsPrefixExpansion() const QTC_OVERRIDE
{
return false;
}
......@@ -937,7 +938,7 @@ public:
: 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();
......@@ -1728,7 +1729,7 @@ public:
: QObject(parent), m_handler(handler)
{}
virtual ~DeferredDeleter()
~DeferredDeleter()
{
if (m_handler) {
m_handler->disconnectFromEditor();
......
......@@ -46,7 +46,9 @@
#include <texteditor/codeassist/genericproposal.h>
#include <texteditor/codeassist/functionhintproposal.h>
#include <cplusplus/ExpressionUnderCursor.h>
#include <utils/faketooltip.h>
#include <utils/qtcoverride.h>
#include <QIcon>
#include <QPainter>
......@@ -149,10 +151,10 @@ public:
, m_currentArg(-1)
{}
virtual void reset() {}
virtual int size() const { return m_items.size(); }
virtual QString text(int index) const;
virtual int activeArgument(const QString &prefix) const;
void reset() QTC_OVERRIDE {}
int size() const QTC_OVERRIDE { return m_items.size(); }
QString text(int index) const QTC_OVERRIDE;
int activeArgument(const QString &prefix) const QTC_OVERRIDE;
private:
QVector<GLSL::Function *> m_items;
......
......@@ -37,6 +37,8 @@
#include <texteditor/codeassist/defaultassistinterface.h>
#include <texteditor/codeassist/ifunctionhintproposalmodel.h>
#include <utils/qtcoverride.h>
#include <QScopedPointer>
#include <QIcon>
......@@ -54,20 +56,20 @@ class GLSLCompletionAssistProvider : public TextEditor::CompletionAssistProvider
Q_OBJECT
public:
virtual bool supportsEditor(const Core::Id &editorId) const;
virtual TextEditor::IAssistProcessor *createProcessor() const;
bool supportsEditor(const Core::Id &editorId) const QTC_OVERRIDE;
TextEditor::IAssistProcessor *createProcessor() const QTC_OVERRIDE;
virtual int activationCharSequenceLength() const;
virtual bool isActivationCharSequence(const QString &sequence) const;
int activationCharSequenceLength() const QTC_OVERRIDE;
bool isActivationCharSequence(const QString &sequence) const QTC_OVERRIDE;
};
class GLSLCompletionAssistProcessor : public TextEditor::IAssistProcessor
{
public:
GLSLCompletionAssistProcessor();
virtual ~GLSLCompletionAssistProcessor();
~GLSLCompletionAssistProcessor();
virtual TextEditor::IAssistProposal *perform(const TextEditor::IAssistInterface *interface);
TextEditor::IAssistProposal *perform(const TextEditor::IAssistInterface *interface) QTC_OVERRIDE;
private:
TextEditor::IAssistProposal *createContentProposal() const;
......
......@@ -32,6 +32,8 @@
#include <texteditor/codeassist/completionassistprovider.h>
#include <utils/qtcoverride.h>
#include <QStringList>
namespace QmakeProjectManager {
......@@ -43,10 +45,10 @@ class ProFileCompletionAssistProvider : public TextEditor::CompletionAssistProvi
public:
ProFileCompletionAssistProvider();
void init();
virtual ~ProFileCompletionAssistProvider();
~ProFileCompletionAssistProvider();
virtual bool supportsEditor(const Core::Id &editorId) const;
virtual TextEditor::IAssistProcessor *createProcessor() const;
bool supportsEditor(const Core::Id &editorId) const QTC_OVERRIDE;
TextEditor::IAssistProcessor *createProcessor() const QTC_OVERRIDE;
QStringList variables() const;
QStringList functions() const;
private:
......
......@@ -42,6 +42,7 @@
#include <texteditor/completionsettings.h>
#include <utils/qtcassert.h>
#include <utils/qtcoverride.h>
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <qmljs/parser/qmljsast_p.h>
......@@ -136,7 +137,7 @@ public:
, order(order)
{}
virtual void operator()(const Value *base, const QString &name, const Value *value)
void operator()(const Value *base, const QString &name, const Value *value) QTC_OVERRIDE
{
Q_UNUSED(base)
QVariant data;
......@@ -164,7 +165,7 @@ public:
, afterOn(afterOn)
{}
virtual void operator ()(const Value *base, const QString &name, const Value *)
void operator ()(const Value *base, const QString &name, const Value *) QTC_OVERRIDE
{
const CppComponentValue *qmlBase = value_cast<CppComponentValue>(base);
......@@ -246,34 +247,34 @@ private:
(*_propertyProcessor)(_currentObject, name, value);
}
virtual bool processProperty(const QString &name, const Value *value)
bool processProperty(const QString &name, const Value *value) QTC_OVERRIDE
{
process(name, value);
return true;
}
virtual bool processEnumerator(const QString &name, const Value *value)
bool processEnumerator(const QString &name, const Value *value) QTC_OVERRIDE
{
if (! _globalCompletion)
process(name, value);
return true;
}
virtual bool processSignal(const QString &name, const Value *value)
bool processSignal(const QString &name, const Value *value) QTC_OVERRIDE
{
if (_globalCompletion)
process(name, value);
return true;
}
virtual bool processSlot(const QString &name, const Value *value)
bool processSlot(const QString &name, const Value *value) QTC_OVERRIDE
{
if (_enumerateSlots)
process(name, value);
return true;
}
virtual bool processGeneratedSlot(const QString &name, const Value *value)
bool processGeneratedSlot(const QString &name, const Value *value) QTC_OVERRIDE
{
if (_enumerateGeneratedSlots || (_currentObject && _currentObject->className().endsWith(QLatin1String("Keys")))) {
// ### FIXME: add support for attached properties.
......@@ -404,10 +405,10 @@ public:
, m_isVariadic(isVariadic)
{}
virtual void reset() {}
virtual int size() const { return 1; }
virtual QString text(int index) const;
virtual int activeArgument(const QString &prefix) const;
void reset() QTC_OVERRIDE {}
int size() const QTC_OVERRIDE { return 1; }
QString text(int index) const QTC_OVERRIDE;
int activeArgument(const QString &prefix) const QTC_OVERRIDE;
private:
QString m_functionName;
......
......@@ -39,6 +39,8 @@
#include <texteditor/snippets/snippetassistcollector.h>
#include <texteditor/codeassist/defaultassistinterface.h>
#include <utils/qtcoverride.h>
#include <QStringList>
#include <QScopedPointer>
#include <QVariant>
......@@ -54,9 +56,9 @@ class QmlJSCompletionAssistInterface;
class QmlJSAssistProposalItem : public TextEditor::BasicProposalItem
{
public:
virtual bool prematurelyApplies(const QChar &c) const;
virtual void applyContextualContent(TextEditor::BaseTextEditor *editor,
int basePosition) const;
bool prematurelyApplies(const QChar &c) const QTC_OVERRIDE;
void applyContextualContent(TextEditor::BaseTextEditor *editor,
int basePosition) const QTC_OVERRIDE;
};
......@@ -67,9 +69,9 @@ public:
: TextEditor::BasicProposalItemListModel(items)
{}
virtual void filter(const QString &prefix);
virtual void sort(const QString &prefix);
virtual bool keepPerfectMatch(TextEditor::AssistReason reason) const;
void filter(const QString &prefix) QTC_OVERRIDE;
void sort(const QString &prefix) QTC_OVERRIDE;
bool keepPerfectMatch(TextEditor::AssistReason reason) const QTC_OVERRIDE;
};
......@@ -78,12 +80,12 @@ class QmlJSCompletionAssistProvider : public TextEditor::CompletionAssistProvide
Q_OBJECT
public:
virtual bool supportsEditor(const Core::Id &editorId) const;
virtual TextEditor::IAssistProcessor *createProcessor() const;
bool supportsEditor(const Core::Id &editorId) const QTC_OVERRIDE;
TextEditor::IAssistProcessor *createProcessor() const QTC_OVERRIDE;
virtual int activationCharSequenceLength() const;
virtual bool isActivationCharSequence(const QString &sequence) const;
virtual bool isContinuationChar(const QChar &c) const;
int activationCharSequenceLength() const QTC_OVERRIDE;
bool isActivationCharSequence(const QString &sequence) const QTC_OVERRIDE;
bool isContinuationChar(const QChar &c) const QTC_OVERRIDE;
};
......@@ -91,9 +93,9 @@ class QmlJSCompletionAssistProcessor : public TextEditor::IAssistProcessor
{
public:
QmlJSCompletionAssistProcessor();
virtual ~QmlJSCompletionAssistProcessor();
~QmlJSCompletionAssistProcessor();
virtual TextEditor::IAssistProposal *perform(const TextEditor::IAssistInterface *interface);
TextEditor::IAssistProposal *perform(const TextEditor::IAssistInterface *interface) QTC_OVERRIDE;
private:
TextEditor::IAssistProposal *createContentProposal() const;
......
......@@ -38,6 +38,8 @@
#include <texteditor/codeassist/quickfixassistprovider.h>
#include <texteditor/codeassist/quickfixassistprocessor.h>
#include <utils/qtcoverride.h>
namespace QmlJSEditor {
namespace Internal {
......@@ -45,7 +47,7 @@ class QmlJSQuickFixAssistInterface : public TextEditor::DefaultAssistInterface
{
public:
QmlJSQuickFixAssistInterface(QmlJSTextEditorWidget *editor, TextEditor::AssistReason reason);
virtual ~QmlJSQuickFixAssistInterface();
~QmlJSQuickFixAssistInterface();
const QmlJSTools::SemanticInfo &semanticInfo() const;
QmlJSTools::QmlJSRefactoringFilePtr currentFile() const;
......@@ -60,9 +62,9 @@ class QmlJSQuickFixProcessor : public TextEditor::QuickFixAssistProcessor
{
public:
QmlJSQuickFixProcessor(const TextEditor::IAssistProvider *provider);
virtual ~QmlJSQuickFixProcessor();
~QmlJSQuickFixProcessor();
virtual const TextEditor::IAssistProvider *provider() const;
const TextEditor::IAssistProvider *provider() const QTC_OVERRIDE;
private:
const TextEditor::IAssistProvider *m_provider;
......@@ -73,13 +75,13 @@ class QmlJSQuickFixAssistProvider : public TextEditor::QuickFixAssistProvider
{
public:
QmlJSQuickFixAssistProvider();
virtual ~QmlJSQuickFixAssistProvider();
~QmlJSQuickFixAssistProvider();
virtual bool isAsynchronous() const;
virtual bool supportsEditor(const Core::Id &editorId) const;
virtual TextEditor::IAssistProcessor *createProcessor() const;
bool isAsynchronous() const QTC_OVERRIDE;
bool supportsEditor(const Core::Id &editorId) const QTC_OVERRIDE;
TextEditor::IAssistProcessor *createProcessor() const QTC_OVERRIDE;
virtual QList<TextEditor::QuickFixFactory *> quickFixFactories() const;
QList<TextEditor::QuickFixFactory *> quickFixFactories() const QTC_OVERRIDE;
};
} // Internal
......
......@@ -39,6 +39,8 @@
#include <coreplugin/coreconstants.h>
#include <utils/qtcoverride.h>
#include <QApplication>
#include <QClipboard>
......@@ -62,7 +64,7 @@ public:
setText(text);
}
virtual void apply(BaseTextEditor *editor, int /*basePosition*/) const
void apply(BaseTextEditor *editor, int /*basePosition*/) const QTC_OVERRIDE
{
BaseTextEditorWidget *editwidget = editor->editorWidget();
......@@ -87,7 +89,7 @@ private:
class ClipboardAssistProcessor: public IAssistProcessor
{
public:
IAssistProposal *perform(const IAssistInterface *interface)
IAssistProposal *perform(const IAssistInterface *interface) QTC_OVERRIDE
{
if (!interface)
return 0;
......
......@@ -32,6 +32,8 @@
#include "codeassist/iassistprovider.h"
#include <utils/qtcoverride.h>
namespace TextEditor {
namespace Internal {
......@@ -39,8 +41,8 @@ class ClipboardAssistProvider: public IAssistProvider
{
public:
bool isAsynchronous() const;
virtual bool supportsEditor(const Core::Id &editorId) const;
virtual IAssistProcessor *createProcessor() const;
bool supportsEditor(const Core::Id &editorId) const QTC_OVERRIDE;
IAssistProcessor *createProcessor() const QTC_OVERRIDE;
};
} // namespace Internal
......
......@@ -34,6 +34,8 @@
#include <texteditor/texteditor_global.h>
#include <utils/qtcoverride.h>
#include <QVariant>
#include <QIcon>
......@@ -43,13 +45,13 @@ class TEXTEDITOR_EXPORT BasicProposalItem : public IAssistProposalItem
{
public:
BasicProposalItem();
virtual ~BasicProposalItem();
~BasicProposalItem();