Commit 06bb5da6 authored by Kevin Funk's avatar Kevin Funk

Use 'override' where possible

Make Clang happy
parent aa68ed4d
......@@ -32,8 +32,8 @@ class KDEVPYTHONCOMPLETION_EXPORT PythonCodeCompletionWorker : public KDevelop::
public:
PythonCodeCompletionWorker(PythonCodeCompletionModel *parent, const QUrl& document);
virtual KDevelop::CodeCompletionContext* createCompletionContext(KDevelop::DUContextPointer context, const QString& contextText, const QString& followingText, const KDevelop::CursorInRevision& position) const;
virtual void updateContextRange(KTextEditor::Range &contextRange, KTextEditor::View *view, KDevelop::DUContextPointer context) const;
KDevelop::CodeCompletionContext* createCompletionContext(KDevelop::DUContextPointer context, const QString& contextText, const QString& followingText, const KDevelop::CursorInRevision& position) const override;
void updateContextRange(KTextEditor::Range &contextRange, KTextEditor::View *view, KDevelop::DUContextPointer context) const override;
PythonCodeCompletionModel* parent;
};
......
......@@ -396,7 +396,7 @@ public:
}
}
virtual void visitFunctionDefinition(FunctionDefinitionAst* node)
void visitFunctionDefinition(FunctionDefinitionAst* node) override
{
m_declaration.push(node->name->value);
......@@ -409,7 +409,7 @@ public:
m_declaration.pop();
}
virtual void visitClassDefinition(ClassDefinitionAst* node)
void visitClassDefinition(ClassDefinitionAst* node) override
{
m_declaration.push(node->name->value);
......
......@@ -41,7 +41,7 @@ public:
RefactoringCollector(const KDevelop::IndexedDeclaration &decl);
protected:
virtual void processUses(KDevelop::ReferencedTopDUContext topContext) override;
void processUses(KDevelop::ReferencedTopDUContext topContext) override;
};
class Refactoring : public KDevelop::BasicRefactoring
......@@ -52,7 +52,7 @@ public:
explicit Refactoring(QObject *parent = 0);
protected:
virtual bool acceptForContextMenu(const KDevelop::Declaration *decl) override;
bool acceptForContextMenu(const KDevelop::Declaration *decl) override;
};
}
......
......@@ -51,7 +51,7 @@ protected:
* @param breakpoint The breakpoint to update.
* @return void
**/
virtual void sendMaybe(KDevelop::Breakpoint* breakpoint);
void sendMaybe(KDevelop::Breakpoint* breakpoint) override;
DebugSession* session();
};
......
......@@ -31,15 +31,15 @@ class DebugJob : public KDevelop::OutputJob
Q_OBJECT
public:
DebugJob();
virtual ~DebugJob();
~DebugJob() override;
/**
* @brief Create a debug session and start it.
*
* @return void
**/
virtual void start();
virtual bool doKill();
void start() override;
bool doKill() override;
QUrl m_scriptUrl;
QString m_interpreter;
......
......@@ -43,10 +43,10 @@ class DebugSession : public KDevelop::IDebugSession
Q_OBJECT
public:
DebugSession(QStringList program, const QUrl& workingDirectory);
virtual ~DebugSession();
~DebugSession() override;
virtual IBreakpointController* breakpointController() const;
virtual IFrameStackModel* frameStackModel() const;
IBreakpointController* breakpointController() const override;
IFrameStackModel* frameStackModel() const override;
/**
* @brief Start the debugger.
......@@ -106,33 +106,33 @@ public:
/**
* @brief Access this session's variable controller
**/
virtual IVariableController* variableController() const;
IVariableController* variableController() const override;
/// Those functions just execute the basic debugger commands. They're used when the user
/// clicks the appropriate button.
virtual void stepOut();
virtual void stepOverInstruction();
virtual void stepInto();
virtual void stepIntoInstruction();
virtual void stepOver();
virtual void jumpToCursor();
virtual void runToCursor();
virtual void run();
virtual void restartDebugger();
void stepOut() override;
void stepOverInstruction() override;
void stepInto() override;
void stepIntoInstruction() override;
void stepOver() override;
void jumpToCursor() override;
void runToCursor() override;
void run() override;
void restartDebugger() override;
virtual bool restartAvaliable() const;
bool restartAvaliable() const override;
/**
* @brief Interrupt the running program with SIGINT and set the state to PausedState
**/
virtual void interruptDebugger();
void interruptDebugger() override;
/**
* @brief Kill the debugger and program being debugged.
* This tries to send a "quit" command, and if the debugger doesn't react to that quickly,
* it'll just kill it.
**/
virtual void stopDebugger();
void stopDebugger() override;
/**
* @brief Gives the debugger state.
......@@ -141,7 +141,7 @@ public:
*
* @return :IDebugSession::DebuggerState the current state the debugger is in
**/
virtual IDebugSession::DebuggerState state() const;
IDebugSession::DebuggerState state() const override;
/**
* @brief Change the debugger state, and trigger various events depending on the previous and new state.
......@@ -313,7 +313,7 @@ public:
, m_command(command) {
m_type = InvalidType;
};
void run(DebugSession* session) {
void run(DebugSession* session) override {
Q_ASSERT(m_command.endsWith('\n') && "command must end with a newline");
qCDebug(KDEV_PYTHON_DEBUGGER) << "running command:" << m_command<< m_notifyMethod;
session->write(m_command.toUtf8());
......
......@@ -31,7 +31,7 @@ class PdbDebuggerPlugin : public KDevelop::IPlugin
Q_OBJECT
public:
PdbDebuggerPlugin(QObject* parent, const QVariantList& = QVariantList());
~PdbDebuggerPlugin();
~PdbDebuggerPlugin() override;
};
}
......
......@@ -34,8 +34,8 @@ class PdbFrameStackModel : public KDevelop::FrameStackModel
Q_OBJECT
public:
PdbFrameStackModel(IDebugSession* session);
virtual void fetchFrames(int threadNumber, int from, int to);
virtual void fetchThreads();
void fetchFrames(int threadNumber, int from, int to) override;
void fetchThreads() override;
/// pdb does not support "select-frame n", so we have to use "up" and "down" repeatedly
/// to select frames. Those two functions tell at which frame the debugger is internally.
......
......@@ -36,7 +36,7 @@ public:
* @param callback Object to notify. Skipped if 0. Defaults to 0.
* @param callbackMethod Method to call. Skipped if 0. Defaults to 0.
**/
virtual void attachMaybe(QObject* callback = 0, const char* callbackMethod = 0);
void attachMaybe(QObject* callback = 0, const char* callbackMethod = 0) override;
/**
* @brief Fetches children (list items, object attributes...) for this variable.
......@@ -44,7 +44,7 @@ public:
* if there's 20.000 of them
* This is invoked if the user clicks the "expand" icon in any variable tree view
**/
virtual void fetchMoreChildren();
void fetchMoreChildren() override;
QObject* m_notifyCreated;
const char* m_notifyCreatedMethod;
......
......@@ -32,13 +32,13 @@ class VariableController : public KDevelop::IVariableController
Q_OBJECT
public:
VariableController(IDebugSession* parent);
virtual void addWatch(KDevelop::Variable* variable);
virtual void addWatchpoint(KDevelop::Variable* variable);
void addWatch(KDevelop::Variable* variable) override;
void addWatchpoint(KDevelop::Variable* variable) override;
/**
* @brief This just calls the Variable constructor and returns a new, empty \a Variable object.
**/
virtual KDevelop::Variable* createVariable(KDevelop::TreeModel* model, KDevelop::TreeItem* parent,
KDevelop::Variable* createVariable(KDevelop::TreeModel* model, KDevelop::TreeItem* parent,
const QString& expression, const QString& display = "") override;
/**
......@@ -51,18 +51,18 @@ public:
* @param cursor the cursor position
* @return The expression to print. Should be an (at least syntactically) valid python expression
**/
virtual KTextEditor::Range expressionRangeUnderCursor(KTextEditor::Document* doc, const KTextEditor::Cursor& cursor) override;
KTextEditor::Range expressionRangeUnderCursor(KTextEditor::Document* doc, const KTextEditor::Cursor& cursor) override;
/**
* @brief Update locals and/or watches, as indicated by autoUpdate().
**/
virtual void update() override;
void update() override;
protected:
/**
* @brief Overriden to handle frame change events (when the user clicks the frame list).
* This then enqueues many "up" or "down" commands to react to the frame change.
**/
virtual void handleEvent(IDebugSession::event_t event) override;
void handleEvent(IDebugSession::event_t event) override;
private:
QTimer m_updateTimer;
......
......@@ -29,15 +29,15 @@ class DocfilesKCModule : public KDevelop::ConfigPage
Q_OBJECT
public:
DocfilesKCModule(KDevelop::IPlugin* plugin, QWidget* parent);
virtual ~DocfilesKCModule();
~DocfilesKCModule() override;
virtual QString name() const override;
virtual QString fullName() const override;
virtual QIcon icon() const override;
QString name() const override;
QString fullName() const override;
QIcon icon() const override;
virtual void apply() override;
virtual void reset() override;
virtual void defaults() override;
void apply() override;
void reset() override;
void defaults() override;
private:
DocfileManagerWidget* managerWidget;
......
......@@ -36,7 +36,7 @@ namespace Python {
class MissingIncludeProblem : public KDevelop::Problem {
public:
MissingIncludeProblem(const QString& moduleName, KDevelop::IndexedString currentDocument);
virtual QExplicitlySharedDataPointer<KDevelop::IAssistant> solutionAssistant() const override;
QExplicitlySharedDataPointer<KDevelop::IAssistant> solutionAssistant() const override;
private:
QString m_moduleName;
......@@ -48,10 +48,10 @@ class DocumentationGeneratorAction : public KDevelop::IAssistantAction
Q_OBJECT
public:
DocumentationGeneratorAction(const QString& module, const KDevelop::IndexedString& document);
virtual QString description() const;
QString description() const override;
public slots:
virtual void execute();
void execute() override;
private:
const QString module;
......@@ -63,7 +63,7 @@ class MissingIncludeAssistant : public KDevelop::IAssistant
Q_OBJECT
public:
MissingIncludeAssistant(const QString& module, const KDevelop::IndexedString& document);
virtual void createActions();
void createActions() override;
private:
const QString module;
const KDevelop::IndexedString document;
......
......@@ -39,8 +39,8 @@ public:
QString m_fullyQualifiedModuleIdentifier;
protected:
virtual void htmlIdentifiedType(KDevelop::AbstractType::Ptr type, const KDevelop::IdentifiedType* idType);
virtual void eventuallyMakeTypeLinks(AbstractType::Ptr type);
void htmlIdentifiedType(KDevelop::AbstractType::Ptr type, const KDevelop::IdentifiedType* idType) override;
void eventuallyMakeTypeLinks(AbstractType::Ptr type) override;
QString getLink(const QString& name, DeclarationPointer declaration, NavigationAction::Type actionType);
};
......
......@@ -44,7 +44,7 @@ class DUChainBench : public QObject
public:
explicit DUChainBench(QObject* parent = 0);
void initShell();
virtual ~DUChainBench();
~DUChainBench() override;
KDevelop::ReferencedTopDUContext parse(const QString& code);
......
......@@ -616,7 +616,7 @@ public:
bool found;
KTextEditor::Range searchingForRange;
QString searchingForIdentifier;
virtual void visitAttribute(AttributeAst* node) {
void visitAttribute(AttributeAst* node) override {
auto r = KTextEditor::Range(0, node->startCol, 0, node->endCol);
qDebug() << "Found attr: " << r << node->attribute->value << ", looking for: " << searchingForRange << searchingForIdentifier;
if ( r == searchingForRange && node->attribute->value == searchingForIdentifier ) {
......@@ -625,7 +625,7 @@ public:
}
AstDefaultVisitor::visitAttribute(node);
}
virtual void visitFunctionDefinition(FunctionDefinitionAst* node) {
void visitFunctionDefinition(FunctionDefinitionAst* node) override {
auto r = KTextEditor::Range(0, node->name->startCol, 0, node->name->endCol);
qDebug() << "Found func: " << r << node->name->value << ", looking for: " << searchingForRange << searchingForIdentifier;
qDebug() << node->arguments->vararg << node->arguments->kwarg;
......@@ -651,7 +651,7 @@ public:
}
AstDefaultVisitor::visitFunctionDefinition(node);
}
virtual void visitClassDefinition(ClassDefinitionAst* node) {
void visitClassDefinition(ClassDefinitionAst* node) override {
auto r = KTextEditor::Range(0, node->name->startCol, 0, node->name->endCol);
qDebug() << "Found cls: " << r << node->name->value << ", looking for: " << searchingForRange << searchingForIdentifier;
if ( r == searchingForRange && node->name->value == searchingForIdentifier ) {
......@@ -660,7 +660,7 @@ public:
}
AstDefaultVisitor::visitClassDefinition(node);
}
virtual void visitImport(ImportAst* node) {
void visitImport(ImportAst* node) override {
foreach ( const AliasAst* name, node->names ) {
if ( name->name ) {
qDebug() << "found import" << name->name->value << name->name->range();
......@@ -754,7 +754,7 @@ public:
QString searchingForType;
TopDUContextPointer ctx;
bool found;
virtual void visitName(NameAst* node) {
void visitName(NameAst* node) override {
if ( node->identifier->value != "checkme" ) return;
QList<Declaration*> decls = ctx->findDeclarations(QualifiedIdentifier(node->identifier->value));
if ( ! decls.length() ) {
......
......@@ -45,7 +45,7 @@ class PyDUChainTest : public QObject
public:
explicit PyDUChainTest(QObject* parent = 0);
void initShell();
virtual ~PyDUChainTest();
~PyDUChainTest() override;
KDevelop::ReferencedTopDUContext parse(const QString& code);
......
......@@ -50,7 +50,7 @@ namespace Python
// Update the "end" cursors of all nodes in the given tree.
class RangeUpdateVisitor : public AstDefaultVisitor {
public:
virtual void visitNode(Ast* node) {
void visitNode(Ast* node) override {
AstDefaultVisitor::visitNode(node);
if ( node && node->parent && node->parent->astType != Ast::AttributeAstType ) {
if ( ( node->parent->endLine <= node->endLine && node->parent->endCol <= node->endCol )
......@@ -81,7 +81,7 @@ public:
return m_next;
};
virtual void visitNode(Python::Ast* node) override {
void visitNode(Python::Ast* node) override {
if ( ! node ) {
return;
}
......@@ -112,16 +112,16 @@ class RangeFixVisitor : public AstDefaultVisitor {
public:
RangeFixVisitor(const QString& contents)
: lines(contents.split('\n')) { };
virtual void visitFunctionDefinition(FunctionDefinitionAst* node) override {
void visitFunctionDefinition(FunctionDefinitionAst* node) override {
cutDefinitionPreamble(node->name, node->async ? "asyncdef" : "def");
AstDefaultVisitor::visitFunctionDefinition(node);
};
virtual void visitClassDefinition(ClassDefinitionAst* node) override {
void visitClassDefinition(ClassDefinitionAst* node) override {
cutDefinitionPreamble(node->name, "class");
AstDefaultVisitor::visitClassDefinition(node);
};
virtual void visitAttribute(AttributeAst* node) override {
void visitAttribute(AttributeAst* node) override {
// Work around the weird way to count columns in Python's AST module.
// Find where the next expression (of any kind) behind this one starts
......@@ -165,7 +165,7 @@ public:
// alias for imports (import foo as bar, baz as bang)
// no strings, brackets, or whatever are allowed here, so the "parser"
// can be very straightforward.
virtual void visitImport(ImportAst* node) override {
void visitImport(ImportAst* node) override {
AstDefaultVisitor::visitImport(node);
int aliasIndex = 0;
foreach ( AliasAst* alias, node->names ) {
......@@ -175,7 +175,7 @@ public:
};
// alias for exceptions (except FooBarException as somethingterriblehappened: ...)
virtual void visitExceptionHandler(ExceptionHandlerAst* node) override {
void visitExceptionHandler(ExceptionHandlerAst* node) override {
AstDefaultVisitor::visitExceptionHandler(node);
if ( ! node->name ) {
return;
......
......@@ -54,7 +54,7 @@ public:
}
}
virtual void visitIdentifier(Identifier* node) {
void visitIdentifier(Identifier* node) override {
if (node) {
fixIdentifier(node);
}
......
......@@ -76,16 +76,16 @@ CodeAst::Ptr PyAstTest::getAst(QString code)
class VerifyVisitor : public AstDefaultVisitor {
public:
VerifyVisitor() : AstDefaultVisitor(), m_nodecount(0) { };
virtual void visitNode(Ast* node) {
void visitNode(Ast* node) override {
m_nodecount += 1;
QVERIFY(! node || node->astType < Ast::LastAstType);
AstDefaultVisitor::visitNode(node);
};
virtual void visitName(NameAst* node) {
void visitName(NameAst* node) override {
QVERIFY(! node->identifier->value.isNull());
AstDefaultVisitor::visitName(node);
};
virtual void visitCode(CodeAst* node) {
void visitCode(CodeAst* node) override {
AstDefaultVisitor::visitCode(node);
qDebug() << "done, nodes visited:" << m_nodecount;
};
......
......@@ -70,16 +70,16 @@ CodeAst::Ptr PyCythonTest::getAst(QString code, const QUrl& filename)
class VerifyVisitor : public AstDefaultVisitor {
public:
VerifyVisitor() : AstDefaultVisitor(), m_nodecount(0) { };
virtual void visitNode(Ast* node) {
void visitNode(Ast* node) override {
m_nodecount += 1;
QVERIFY(! node || node->astType < Ast::LastAstType);
AstDefaultVisitor::visitNode(node);
};
virtual void visitName(NameAst* node) {
void visitName(NameAst* node) override {
QVERIFY(! node->identifier->value.isNull());
AstDefaultVisitor::visitName(node);
};
virtual void visitCode(CodeAst* node) {
void visitCode(CodeAst* node) override {
AstDefaultVisitor::visitCode(node);
qDebug() << "done, nodes visited:" << m_nodecount;
};
......
......@@ -34,11 +34,11 @@ class PEP8KCModule : public KDevelop::ConfigPage
Q_OBJECT
public:
PEP8KCModule(KDevelop::IPlugin* plugin, QWidget* parent = nullptr);
~PEP8KCModule();
~PEP8KCModule() override;
virtual QString name() const override;
virtual QString fullName() const override;
virtual QIcon icon() const override;
QString name() const override;
QString fullName() const override;
QIcon icon() const override;
// TODO: use KConfigXT instead (this will additionally allow removing apply/reset/defaults)
......@@ -46,9 +46,9 @@ public:
static bool isPep8Enabled(const KConfigGroup& group);
static QString pep8Arguments(const KConfigGroup& group);
virtual void apply() override;
virtual void reset() override;
virtual void defaults() override;
void apply() override;
void reset() override;
void defaults() override;
private:
KConfigGroup configGroup;
QLineEdit* pep8url;
......
......@@ -35,8 +35,8 @@ class Highlighting;
class CodeHighlightingInstance : public KDevelop::CodeHighlightingInstance {
public:
CodeHighlightingInstance(const Highlighting* highlighting);
virtual void highlightUse(KDevelop::DUContext* context, int index, const QColor& color);
virtual bool useRainbowColor(KDevelop::Declaration* dec) const;
void highlightUse(KDevelop::DUContext* context, int index, const QColor& color) override;
bool useRainbowColor(KDevelop::Declaration* dec) const override;
private:
void checkHasBlocks(KDevelop::TopDUContext* top) const;
mutable bool checked_blocks;
......@@ -49,7 +49,7 @@ class Highlighting : public KDevelop::CodeHighlighting
Q_OBJECT
public:
Highlighting( QObject* parent );
virtual CodeHighlightingInstance* createInstance() const;
CodeHighlightingInstance* createInstance() const override;
};
}
#endif
......@@ -54,30 +54,30 @@ class LanguageSupport
public:
LanguageSupport( QObject *parent, const QVariantList& args = QVariantList() );
virtual ~LanguageSupport();
~LanguageSupport() override;
/*Name Of the Language*/
QString name() const;
QString name() const override;
/*Parsejob used by background parser to parse given Url*/
KDevelop::ParseJob *createParseJob( const KDevelop::IndexedString &url );
KDevelop::ParseJob *createParseJob( const KDevelop::IndexedString &url ) override;
/*the code highlighter*/
KDevelop::ICodeHighlighting* codeHighlighting() const;
virtual KDevelop::BasicRefactoring* refactoring() const override;
KDevelop::ICodeHighlighting* codeHighlighting() const override;
KDevelop::BasicRefactoring* refactoring() const override;
KDevelop::ContextMenuExtension contextMenuExtension(KDevelop::Context* context);
KDevelop::ContextMenuExtension contextMenuExtension(KDevelop::Context* context) override;
static LanguageSupport* self();
virtual WhitespaceSensitivity whitespaceSensititivy() const;
WhitespaceSensitivity whitespaceSensititivy() const override;
virtual KDevelop::SourceFormatterItemList sourceFormatterItems() const;
KDevelop::SourceFormatterItemList sourceFormatterItems() const override;
/// Tells whether this plugin is enabled for the given file.
static bool enabledForFile(const QUrl& url);
virtual QList<KDevelop::ILanguageCheck*> providedChecks();
QList<KDevelop::ILanguageCheck*> providedChecks() override;
virtual int configPages() const override;
virtual KDevelop::ConfigPage* configPage(int number, QWidget* parent) override;
int configPages() const override;
KDevelop::ConfigPage* configPage(int number, QWidget* parent) override;
public slots:
void documentOpened(KDevelop::IDocument*);
......
......@@ -50,17 +50,17 @@ public:
PEP8Checking = (KDevelop::TopDUContext::LastFeature << 2)
};
ParseJob(const IndexedString& url, ILanguageSupport* languageSupport );
virtual ~ParseJob();
~ParseJob() override;
virtual CodeAst* ast() const;
bool wasReadFromDisk() const;
static void eventuallyDoPEP8Checking(const IndexedString document, TopDUContext* topContext);
virtual ControlFlowGraph* controlFlowGraph();
virtual DataAccessRepository* dataAccessInformation();
ControlFlowGraph* controlFlowGraph() override;
DataAccessRepository* dataAccessInformation() override;
protected:
virtual void run(ThreadWeaver::JobPointer self, ThreadWeaver::Thread* thread) override;
void run(ThreadWeaver::JobPointer self, ThreadWeaver::Thread* thread) override;
private:
QList<QUrl> m_cachedCustomIncludes;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment