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

Const'ify some pointer

parent a726b918
Pipeline #52534 passed with stage
in 42 minutes and 47 seconds
......@@ -13,8 +13,8 @@
using namespace MessageViewer;
DKIMManagerKey::DKIMManagerKey(QObject *parent)
: QObject(parent)
, mQcaInitializer(new QCA::Initializer(QCA::Practical, 64))
{
mQcaInitializer = new QCA::Initializer(QCA::Practical, 64);
loadKeys();
}
......
......@@ -68,7 +68,7 @@ public:
private:
Q_REQUIRED_RESULT QStringList keyRecorderList(KSharedConfig::Ptr &config) const;
QVector<KeyInfo> mKeys;
QCA::Initializer *mQcaInitializer = nullptr;
QCA::Initializer *const mQcaInitializer;
};
}
Q_DECLARE_TYPEINFO(MessageViewer::KeyInfo, Q_MOVABLE_TYPE);
......
......@@ -19,11 +19,11 @@ static const char myDKIMManagerKeyDialogConfigGroupName[] = "DKIMManagerKeyDialo
using namespace MessageViewer;
DKIMManagerKeyDialog::DKIMManagerKeyDialog(QWidget *parent)
: QDialog(parent)
, mManagerWidget(new DKIMManagerKeyWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mManagerWidget = new DKIMManagerKeyWidget(this);
mManagerWidget->setObjectName(QStringLiteral("managerWidget"));
mainLayout->addWidget(mManagerWidget);
......
......@@ -29,7 +29,7 @@ private:
void writeConfig();
void loadKeys();
void slotAccept();
DKIMManagerKeyWidget *mManagerWidget = nullptr;
DKIMManagerKeyWidget *const mManagerWidget;
};
}
......
......@@ -20,12 +20,12 @@
using namespace MessageViewer;
DKIMManagerKeyWidget::DKIMManagerKeyWidget(QWidget *parent)
: QWidget(parent)
, mTreeWidget(new QTreeWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setContentsMargins({});
mTreeWidget = new QTreeWidget(this);
mTreeWidget->setObjectName(QStringLiteral("treewidget"));
mTreeWidget->setRootIsDecorated(false);
mTreeWidget->setHeaderLabels({i18n("SDID"), i18n("Selector"), i18n("DKIM Key")});
......
......@@ -30,7 +30,7 @@ public:
private:
void slotCustomContextMenuRequested(const QPoint &);
QTreeWidget *mTreeWidget = nullptr;
QTreeWidget *const mTreeWidget;
};
}
......
......@@ -25,12 +25,12 @@ using namespace MessageViewer;
DKIMManageRulesDialog::DKIMManageRulesDialog(QWidget *parent)
: QDialog(parent)
, mRulesWidget(new DKIMManageRulesWidget(this))
{
setWindowTitle(i18nc("@title:window", "Configure Rule"));
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mRulesWidget = new DKIMManageRulesWidget(this);
mRulesWidget->setObjectName(QStringLiteral("mRulesWidget"));
mainLayout->addWidget(mRulesWidget);
......
......@@ -28,7 +28,7 @@ private:
void writeConfig();
void slotImport();
void slotExport();
DKIMManageRulesWidget *mRulesWidget = nullptr;
DKIMManageRulesWidget *const mRulesWidget;
};
}
......
......@@ -20,8 +20,8 @@
using namespace MessageViewer;
DKIMManageRulesWidgetItem::DKIMManageRulesWidgetItem(QTreeWidget *parent)
: QTreeWidgetItem(parent)
, mRuleTypeCombobox(new DKIMManageRulesComboBox)
{
mRuleTypeCombobox = new DKIMManageRulesComboBox;
treeWidget()->setItemWidget(this, ColumnType::RuleType, mRuleTypeCombobox);
}
......@@ -55,12 +55,12 @@ void DKIMManageRulesWidgetItem::updateInfo()
DKIMManageRulesWidget::DKIMManageRulesWidget(QWidget *parent)
: QWidget(parent)
, mTreeWidget(new QTreeWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins({});
mTreeWidget = new QTreeWidget(this);
mTreeWidget->setObjectName(QStringLiteral("treewidget"));
mTreeWidget->setRootIsDecorated(false);
mTreeWidget->setHeaderLabels({i18n("Active"), i18n("Domain"), i18n("List-ID"), i18n("From"), i18n("SDID"), i18n("Rule type"), i18n("Priority")});
......
......@@ -40,7 +40,7 @@ public:
private:
void updateInfo();
MessageViewer::DKIMRule mRule;
DKIMManageRulesComboBox *mRuleTypeCombobox = nullptr;
DKIMManageRulesComboBox *const mRuleTypeCombobox;
};
/**
......@@ -64,7 +64,7 @@ private:
void modifyRule(DKIMManageRulesWidgetItem *rulesItem);
void slotCustomContextMenuRequested(const QPoint &);
void duplicateRule(DKIMManageRulesWidgetItem *rulesItem);
QTreeWidget *mTreeWidget = nullptr;
QTreeWidget *const mTreeWidget;
};
}
#endif // DKIMMANAGERULESWIDGET_H
......@@ -21,13 +21,13 @@ static const char myDKIMRuleDialogConfigGroupName[] = "DKIMRuleDialog";
using namespace MessageViewer;
DKIMRuleDialog::DKIMRuleDialog(QWidget *parent)
: QDialog(parent)
, mRuleWidget(new DKIMRuleWidget(this))
{
setWindowTitle(i18nc("@title:window", "Add Rule"));
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mRuleWidget = new DKIMRuleWidget(this);
mRuleWidget->setObjectName(QStringLiteral("rulewidget"));
mainLayout->addWidget(mRuleWidget);
......
......@@ -28,7 +28,7 @@ private:
void slotAccepted();
void writeConfig();
void readConfig();
DKIMRuleWidget *mRuleWidget = nullptr;
DKIMRuleWidget *const mRuleWidget;
QPushButton *mOkButton = nullptr;
};
}
......
......@@ -17,12 +17,12 @@
using namespace MessageViewer;
DKIMWidgetInfo::DKIMWidgetInfo(QWidget *parent)
: QWidget(parent)
, mLabel(new QLabel(this))
{
auto mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins({});
mLabel = new QLabel(this);
mLabel->setAutoFillBackground(true);
mLabel->setObjectName(QStringLiteral("label"));
mainLayout->addWidget(mLabel);
......
......@@ -37,7 +37,7 @@ private:
void updateToolTip();
void initColors();
MessageViewer::DKIMCheckSignatureJob::CheckSignatureResult mResult;
QLabel *mLabel = nullptr;
QLabel *const mLabel;
QColor mWarningColor;
QColor mErrorColor;
QColor mOkColor;
......
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