Commit 067308b6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify pointer

parent f8f5d1de
Pipeline #151815 skipped
......@@ -21,6 +21,7 @@ using namespace KPIMTextEdit;
InsertHtmlEditor::InsertHtmlEditor(QWidget *parent)
: KPIMTextEdit::PlainTextEditor(parent)
, mTextEditorCompleter(new KPIMTextEdit::TextEditorCompleter(this, this))
{
const KSyntaxHighlighting::Definition def = mRepo.definitionForName(QStringLiteral("HTML"));
if (!def.isValid()) {
......@@ -32,7 +33,6 @@ InsertHtmlEditor::InsertHtmlEditor(QWidget *parent)
: mRepo.defaultTheme(KSyntaxHighlighting::Repository::LightTheme));
hl->setDefinition(def);
setFocus();
mTextEditorCompleter = new KPIMTextEdit::TextEditorCompleter(this, this);
const QStringList completerList = {QStringLiteral("<b></b>"), QStringLiteral("<i></i>"), QStringLiteral("<u></u>")};
// Add more
mTextEditorCompleter->setCompleterStringList(completerList);
......
......@@ -26,7 +26,7 @@ protected:
void keyPressEvent(QKeyEvent *e) override;
private:
KPIMTextEdit::TextEditorCompleter *mTextEditorCompleter = nullptr;
KPIMTextEdit::TextEditorCompleter *const mTextEditorCompleter;
KSyntaxHighlighting::Repository mRepo;
};
}
......
Supports Markdown
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