Commit 95e8909c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify pointer

parent 6416f382
Pipeline #51526 passed with stage
in 54 minutes and 41 seconds
......@@ -15,6 +15,7 @@ using namespace MailMerge;
CsvWidget::CsvWidget(QWidget *parent)
: QWidget(parent)
, mCvsUrlRequester(new KUrlRequester(this))
{
QVBoxLayout *csvWidgetLayout = new QVBoxLayout(this);
csvWidgetLayout->setObjectName(QStringLiteral("csvWidgetLayout"));
......@@ -23,7 +24,6 @@ CsvWidget::CsvWidget(QWidget *parent)
QLabel *lab = new QLabel(i18n("Path:"), this);
lab->setObjectName(QStringLiteral("label"));
csvWidgetLayout->addWidget(lab);
mCvsUrlRequester = new KUrlRequester(this);
mCvsUrlRequester->setObjectName(QStringLiteral("cvsurlrequester"));
csvWidgetLayout->addWidget(mCvsUrlRequester);
}
......
......@@ -21,10 +21,10 @@ public:
~CsvWidget() override;
void setPath(const QUrl &path);
QUrl path() const;
Q_REQUIRED_RESULT QUrl path() const;
private:
KUrlRequester *mCvsUrlRequester = nullptr;
KUrlRequester *const mCvsUrlRequester;
};
}
......
......@@ -22,6 +22,10 @@ using namespace MailMerge;
MailMergeWidget::MailMergeWidget(QWidget *parent)
: QWidget(parent)
, mSource(new QComboBox(this))
, mStackedWidget(new QStackedWidget(this))
, mCsvWidget(new MailMerge::CsvWidget(this))
, mAddressbookWidget(new MailMerge::AddressBookWidget(this))
{
QVBoxLayout *vbox = new QVBoxLayout(this);
......@@ -31,7 +35,6 @@ MailMergeWidget::MailMergeWidget(QWidget *parent)
QLabel *lab = new QLabel(i18n("Source:"), this);
hbox->addWidget(lab);
mSource = new QComboBox(this);
mSource->setObjectName(QStringLiteral("source"));
mSource->addItem(i18n("Address Book"), AddressBook);
mSource->addItem(i18n("CSV"), CSV);
......@@ -40,15 +43,12 @@ MailMergeWidget::MailMergeWidget(QWidget *parent)
hbox->addWidget(mSource);
mStackedWidget = new QStackedWidget(this);
mStackedWidget->setObjectName(QStringLiteral("stackedwidget"));
vbox->addWidget(mStackedWidget);
mAddressbookWidget = new MailMerge::AddressBookWidget(this);
mAddressbookWidget->setObjectName(QStringLiteral("addressbookwidget"));
mStackedWidget->addWidget(mAddressbookWidget);
mCsvWidget = new MailMerge::CsvWidget(this);
mCsvWidget->setObjectName(QStringLiteral("csvwidget"));
mStackedWidget->addWidget(mCsvWidget);
......
......@@ -36,11 +36,11 @@ private Q_SLOTS:
void slotSourceChanged(int index);
private:
QComboBox *mSource = nullptr;
QStackedWidget *mStackedWidget = nullptr;
QComboBox *const mSource;
QStackedWidget *const mStackedWidget;
AttachmentListWidget *mAttachment = nullptr;
MailMerge::CsvWidget *mCsvWidget = nullptr;
MailMerge::AddressBookWidget *mAddressbookWidget = nullptr;
MailMerge::CsvWidget *const mCsvWidget;
MailMerge::AddressBookWidget *const mAddressbookWidget;
};
}
#endif // MAILMERGEWIDGET_H
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