Commit c595fed3 authored by Laurent Montel's avatar Laurent Montel
Browse files

Const'ify pointer

parent 881978c1
Pipeline #227039 passed with stage
in 1 minute and 27 seconds
......@@ -13,24 +13,24 @@
JobTrackerSearchWidget::JobTrackerSearchWidget(QWidget *parent)
: QWidget(parent)
, mSearchLineEdit(new QLineEdit(this))
, mSelectColumn(new QComboBox(this))
, mSelectOnlyError(new QCheckBox(QStringLiteral("Show Only Errors"), this))
{
auto mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
mSearchLineEdit = new QLineEdit(this);
mSearchLineEdit->setObjectName(QStringLiteral("searchline"));
mSearchLineEdit->setClearButtonEnabled(true);
mSearchLineEdit->setPlaceholderText(QStringLiteral("Search..."));
mainLayout->addWidget(mSearchLineEdit);
connect(mSearchLineEdit, &QLineEdit::textChanged, this, &JobTrackerSearchWidget::searchTextChanged);
mSelectOnlyError = new QCheckBox(QStringLiteral("Show Only Errors"), this);
mSelectOnlyError->setObjectName(QStringLiteral("selectonlyerror"));
mainLayout->addWidget(mSelectOnlyError);
connect(mSelectOnlyError, &QCheckBox::toggled, this, &JobTrackerSearchWidget::selectOnlyErrorChanged);
mSelectColumn = new QComboBox(this);
mSelectColumn->setObjectName(QStringLiteral("selectcolumn"));
mainLayout->addWidget(mSelectColumn);
mSelectColumn->addItem(QStringLiteral("All Columns"), -1);
......
......@@ -29,8 +29,8 @@ private Q_SLOTS:
void slotColumnChanged(int index);
private:
QLineEdit *mSearchLineEdit = nullptr;
QComboBox *mSelectColumn = nullptr;
QCheckBox *mSelectOnlyError = nullptr;
QLineEdit *const mSearchLineEdit;
QComboBox *const mSelectColumn;
QCheckBox *const mSelectOnlyError;
};
......@@ -39,7 +39,7 @@ Logging::Logging(QWidget *parent)
auto l = new QVBoxLayout(this);
setLayout(l);
mEnabledCheckbox = new QCheckBox(QStringLiteral("Enable"));
mEnabledCheckbox = new QCheckBox(QStringLiteral("Enable"), this);
connect(mEnabledCheckbox, &QCheckBox::toggled, this, [this](bool toggled) {
Q_EMIT enabledChanged(toggled);
});
......@@ -48,10 +48,10 @@ Logging::Logging(QWidget *parent)
auto h = new QHBoxLayout;
l->addLayout(h);
h->addWidget(new QLabel(QStringLiteral("Programs:")));
h->addWidget(new QLabel(QStringLiteral("Programs:"), this));
h->addWidget(mAppFilter = new KCheckComboBox());
h->setStretchFactor(mAppFilter, 2);
h->addWidget(new QLabel(QStringLiteral("Types:")));
h->addWidget(new QLabel(QStringLiteral("Types:"), this));
h->addWidget(mTypeFilter = new KCheckComboBox());
h->setStretchFactor(mTypeFilter, 2);
mTypeFilter->addItem(QStringLiteral("Debug"), QtDebugMsg);
......@@ -85,7 +85,7 @@ Logging::Logging(QWidget *parent)
h = new QHBoxLayout;
l->addLayout(h);
auto btn = new QPushButton(QStringLiteral("Save to File..."));
auto btn = new QPushButton(QStringLiteral("Save to File..."), this);
connect(btn, &QPushButton::clicked, this, &Logging::saveToFile);
h->addWidget(btn);
h->addStretch(1);
......
......@@ -20,8 +20,8 @@
MainWindow::MainWindow(QWidget *parent)
: KXmlGuiWindow(parent)
, mMain(new MainWidget(this))
{
mMain = new MainWidget(this);
setCentralWidget(mMain);
KStandardAction::quit(qApp, &QApplication::quit, actionCollection());
......
......@@ -24,6 +24,6 @@ protected:
void closeEvent(QCloseEvent *event) override;
private:
MainWidget *mMain;
MainWidget *const mMain;
};
......@@ -27,9 +27,8 @@ Q_DECLARE_METATYPE(Akonadi::NotificationSubscriber)
MonitorsWidget::MonitorsWidget(QWidget *parent)
: QWidget(parent)
, mModel(new MonitorsModel(this))
{
mModel = new MonitorsModel(this);
auto layout = new QHBoxLayout(this);
mTreeView = new QTreeView(this);
......
......@@ -36,6 +36,6 @@ private Q_SLOTS:
private:
QTreeView *mTreeView = nullptr;
QTreeView *mSubscriberView = nullptr;
MonitorsModel *mModel = nullptr;
MonitorsModel *const mModel;
};
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