Commit ff134466 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify pointer

parent 2eaebe60
Pipeline #198856 passed with stage
in 13 minutes and 19 seconds
......@@ -21,6 +21,11 @@ using namespace KPIMTextEdit;
KLinkDialog::KLinkDialog(QWidget *parent)
: QDialog(parent)
, textLabel(new QLabel(i18n("Link Text:"), this))
, textLineEdit(new QLineEdit(this))
, linkUrlLabel(new QLabel(i18n("Link URL:"), this))
, linkUrlLineEdit(new QLineEdit(this))
, buttonBox(new QDialogButtonBox(this))
{
setWindowTitle(i18nc("@title:window", "Manage Link"));
setModal(true);
......@@ -29,11 +34,7 @@ KLinkDialog::KLinkDialog(QWidget *parent)
auto grid = new QGridLayout;
textLabel = new QLabel(i18n("Link Text:"), this);
textLineEdit = new QLineEdit(this);
textLineEdit->setClearButtonEnabled(true);
linkUrlLabel = new QLabel(i18n("Link URL:"), this);
linkUrlLineEdit = new QLineEdit(this);
linkUrlLineEdit->setClearButtonEnabled(true);
grid->addWidget(textLabel, 0, 0);
......@@ -43,7 +44,6 @@ KLinkDialog::KLinkDialog(QWidget *parent)
layout->addLayout(grid);
buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
......
......@@ -70,11 +70,11 @@ public:
private:
void slotTextChanged(const QString &);
QLabel *textLabel = nullptr;
QLineEdit *textLineEdit = nullptr;
QLabel *linkUrlLabel = nullptr;
QLineEdit *linkUrlLineEdit = nullptr;
QDialogButtonBox *buttonBox = nullptr;
QLabel *const textLabel;
QLineEdit *const textLineEdit;
QLabel *const linkUrlLabel;
QLineEdit *const linkUrlLineEdit;
QDialogButtonBox *const buttonBox;
};
}
//@endcond
......@@ -15,8 +15,8 @@
#include <QTextList>
using namespace KPIMTextEdit;
NestedListHelper::NestedListHelper(QTextEdit *te)
: textEdit(te)
{
textEdit = te;
listBottomMargin = 12;
listTopMargin = 12;
listNoMargin = 0;
......
......@@ -115,7 +115,7 @@ private:
void reformatList(QTextBlock block);
void reformatList();
QTextEdit *textEdit = nullptr;
QTextEdit *const textEdit;
int listBottomMargin;
int listTopMargin;
......
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