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

Const'ify pointer

parent ad4862e7
Pipeline #51281 canceled with stage
......@@ -15,11 +15,11 @@
ConfigureCustomSettingDialog::ConfigureCustomSettingDialog(QWidget *parent)
: QDialog(parent)
, mCustomSettingWidget(new ConfigureCustomSettingWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
setWindowTitle(i18nc("@title:window", "Add custom rule"));
mCustomSettingWidget = new ConfigureCustomSettingWidget(this);
mCustomSettingWidget->setObjectName(QStringLiteral("customsettingwidget"));
mainLayout->addWidget(mCustomSettingWidget);
......
......@@ -23,7 +23,7 @@ public:
Q_REQUIRED_RESULT QString rule() const;
private:
ConfigureCustomSettingWidget *mCustomSettingWidget = nullptr;
ConfigureCustomSettingWidget *const mCustomSettingWidget;
};
#endif // CONFIGURECUSTOMSETTINGDIALOG_H
......@@ -18,12 +18,14 @@
ConfigureCustomSettingWidget::ConfigureCustomSettingWidget(QWidget *parent)
: QWidget(parent)
, mCategoryLineEdit(new KLineEdit(this))
, mEnableCategory(new QCheckBox(i18n("Enable"), this))
, mCategoryType(new CategoryTypeComboBox(true, this))
{
auto vbox = new QVBoxLayout(this);
auto lab = new QLabel(i18n("Category:"), this);
lab->setObjectName(QStringLiteral("category_label"));
mCategoryLineEdit = new KLineEdit(this);
mCategoryLineEdit->setTrapReturnKey(true);
mCategoryLineEdit->setClearButtonEnabled(true);
mCategoryLineEdit->setObjectName(QStringLiteral("category_lineedit"));
......@@ -37,11 +39,9 @@ ConfigureCustomSettingWidget::ConfigureCustomSettingWidget(QWidget *parent)
lab->setObjectName(QStringLiteral("categorytype_label"));
categoryLayout->addWidget(lab);
mCategoryType = new CategoryTypeComboBox(true, this);
mCategoryType->setObjectName(QStringLiteral("categorytype_combobox"));
categoryLayout->addWidget(mCategoryType);
mEnableCategory = new QCheckBox(i18n("Enable"), this);
mEnableCategory->setObjectName(QStringLiteral("enable_category"));
categoryLayout->addWidget(mEnableCategory);
}
......
......@@ -29,9 +29,9 @@ Q_SIGNALS:
private:
void slotTextChanged(const QString &);
KLineEdit *mCategoryLineEdit = nullptr;
QCheckBox *mEnableCategory = nullptr;
CategoryTypeComboBox *mCategoryType = nullptr;
KLineEdit *const mCategoryLineEdit;
QCheckBox *const mEnableCategory;
CategoryTypeComboBox *const mCategoryType;
};
#endif // CONFIGURECUSTOMSETTINGWIDGET_H
......@@ -13,11 +13,11 @@
EnvironmentSettingsRulesPage::EnvironmentSettingsRulesPage(QWidget *parent)
: QWidget(parent)
, mRichTextEdit(new EnvironmentPlainTextEdit(this))
{
auto mainLayout = new QVBoxLayout(this);
auto lab = new QLabel(i18n("Rules:"), this);
lab->setObjectName(QStringLiteral("label"));
mRichTextEdit = new EnvironmentPlainTextEdit(this);
mRichTextEdit->setReadOnly(true);
mRichTextEdit->setObjectName(QStringLiteral("richtext"));
mainLayout->addWidget(lab);
......
......@@ -20,7 +20,7 @@ public:
void setRules(const QString &rules);
private:
EnvironmentPlainTextEdit *mRichTextEdit = nullptr;
EnvironmentPlainTextEdit *const mRichTextEdit;
};
#endif // ENVIRONMENTSETTINGSRULESPAGE_H
......@@ -16,13 +16,16 @@
KDEApplicationDebugSettingPage::KDEApplicationDebugSettingPage(QWidget *parent)
: QWidget(parent)
, mTreeListWidget(new KDEApplicationTreeListWidget(this))
, mTreeListWidgetSearchLine(new KTreeWidgetSearchLine(this, mTreeListWidget))
, mEnableDebug(new QPushButton(i18n("Enable All Debug"), this))
, mTurnOffDebug(new QPushButton(i18n("Turn Off Debug"), this))
, mTurnOffAllMessages(new QPushButton(i18n("Turn Off All Messages"), this))
{
auto mainLayout = new QVBoxLayout(this);
mTreeListWidget = new KDEApplicationTreeListWidget(this);
mTreeListWidget->setObjectName(QStringLiteral("listwidget"));
mTreeListWidgetSearchLine = new KTreeWidgetSearchLine(this, mTreeListWidget);
mTreeListWidgetSearchLine->setPlaceholderText(i18n("Search..."));
mTreeListWidgetSearchLine->setObjectName(QStringLiteral("searchline"));
mTreeListWidgetSearchLine->setSearchColumns(mTreeListWidget->searchColumns());
......@@ -33,17 +36,14 @@ KDEApplicationDebugSettingPage::KDEApplicationDebugSettingPage(QWidget *parent)
auto buttonLayout = new QHBoxLayout;
mainLayout->addLayout(buttonLayout);
mEnableDebug = new QPushButton(i18n("Enable All Debug"), this);
mEnableDebug->setObjectName(QStringLiteral("selectall"));
buttonLayout->addWidget(mEnableDebug);
connect(mEnableDebug, &QAbstractButton::clicked, this, &KDEApplicationDebugSettingPage::slotSelectAllDebug);
mTurnOffDebug = new QPushButton(i18n("Turn Off Debug"), this);
mTurnOffDebug->setObjectName(QStringLiteral("deselectall"));
buttonLayout->addWidget(mTurnOffDebug);
connect(mTurnOffDebug, &QAbstractButton::clicked, this, &KDEApplicationDebugSettingPage::slotDeselectAllDebug);
mTurnOffAllMessages = new QPushButton(i18n("Turn Off All Messages"), this);
mTurnOffAllMessages->setObjectName(QStringLiteral("deselectallmessage"));
buttonLayout->addWidget(mTurnOffAllMessages);
connect(mTurnOffAllMessages, &QAbstractButton::clicked, this, &KDEApplicationDebugSettingPage::slotDeselectAllMessages);
......
......@@ -36,11 +36,11 @@ private:
void slotDeselectAllDebug();
void slotDeselectAllMessages();
KDEApplicationTreeListWidget *mTreeListWidget = nullptr;
KTreeWidgetSearchLine *mTreeListWidgetSearchLine = nullptr;
QPushButton *mEnableDebug = nullptr;
QPushButton *mTurnOffDebug = nullptr;
QPushButton *mTurnOffAllMessages = nullptr;
KDEApplicationTreeListWidget *const mTreeListWidget;
KTreeWidgetSearchLine *const mTreeListWidgetSearchLine;
QPushButton *const mEnableDebug;
QPushButton *const mTurnOffDebug;
QPushButton *const mTurnOffAllMessages;
};
#endif // KDEAPPLICATIONDEBUGSETTINGPAGE_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