Commit 191e7fd7 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify pointer

parent 5557b845
Pipeline #59902 passed with stage
in 15 minutes and 32 seconds
......@@ -13,10 +13,10 @@ using namespace KSieveUi;
AddressLineEdit::AddressLineEdit(QWidget *parent)
: AbstractSelectEmailLineEdit(parent)
, mLineEdit(new QLineEdit(this))
{
auto mainLayout = new QHBoxLayout(this);
mainLayout->setContentsMargins({});
mLineEdit = new QLineEdit(this);
new KPIM::LineEditCatchReturnKey(mLineEdit, this);
mainLayout->addWidget(mLineEdit);
mLineEdit->setClearButtonEnabled(true);
......
......@@ -24,7 +24,7 @@ MultiLineEdit::~MultiLineEdit()
QSize MultiLineEdit::sizeHint() const
{
QFontMetrics fm(font());
const QFontMetrics fm(font());
const int h = qMax(document()->size().toSize().height() - fm.descent() + 2 * frameWidth(), 50);
......
......@@ -25,6 +25,9 @@ static const char selectMultipleHeaders[] = I18N_NOOP("Select multiple headers..
SelectHeadersDialog::SelectHeadersDialog(QWidget *parent)
: QDialog(parent)
, mListWidget(new SelectHeadersWidget(this))
, mNewHeader(new QLineEdit(this))
, mAddNewHeader(new QPushButton(this))
{
setWindowTitle(i18nc("@title:window", "Headers"));
......@@ -42,7 +45,6 @@ SelectHeadersDialog::SelectHeadersDialog(QWidget *parent)
lay->setObjectName(QStringLiteral("widgetlayout"));
lay->setContentsMargins({});
mainLayout->addLayout(lay);
mListWidget = new SelectHeadersWidget(this);
mListWidget->setObjectName(QStringLiteral("listwidget"));
lay->addWidget(mListWidget);
......@@ -52,7 +54,6 @@ SelectHeadersDialog::SelectHeadersDialog(QWidget *parent)
auto hbox = new QHBoxLayout;
mNewHeader = new QLineEdit(this);
new KPIM::LineEditCatchReturnKey(mNewHeader, this);
mNewHeader->setObjectName(QStringLiteral("newheader"));
mNewHeader->setClearButtonEnabled(true);
......@@ -60,7 +61,6 @@ SelectHeadersDialog::SelectHeadersDialog(QWidget *parent)
connect(mNewHeader, &QLineEdit::returnPressed, this, &SelectHeadersDialog::slotAddNewHeader);
mNewHeader->setClearButtonEnabled(true);
mAddNewHeader = new QPushButton(this);
mAddNewHeader->setObjectName(QStringLiteral("addnewheader"));
mAddNewHeader->setEnabled(false);
mAddNewHeader->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
......
......@@ -46,9 +46,9 @@ private:
void slotAddNewHeader();
void readConfig();
void writeConfig();
SelectHeadersWidget *mListWidget = nullptr;
QLineEdit *mNewHeader = nullptr;
QPushButton *mAddNewHeader = nullptr;
SelectHeadersWidget *const mListWidget;
QLineEdit *const mNewHeader;
QPushButton *const mAddNewHeader;
};
class SelectHeaderTypeComboBox : public QComboBox
......
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