Commit d80c4cb2 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Improve the signature we present of an overriden method

Adds the override keyword (and a ; to end the line properly).
Drops the virtual method, because it's redundant to override.

Differential Revision: https://phabricator.kde.org/D382
parent 772b05f3
......@@ -22,6 +22,8 @@
#include "context.h"
#include <QRegularExpression>
#include <interfaces/icore.h>
#include <interfaces/idocumentcontroller.h>
......@@ -157,7 +159,7 @@ public:
void execute(KTextEditor::View* view, const KTextEditor::Range& word) override
{
view->document()->replaceText(word, QLatin1String("virtual ") + m_returnType + QLatin1Char(' ') + m_display);
view->document()->replaceText(word, m_returnType + QLatin1Char(' ') + m_display.replace(QRegularExpression(QStringLiteral("\\s*=\\s*0")), QString()) + QLatin1String(" override;"));
}
private:
......
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