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

modernize code

parent 51debaf4
Pipeline #37449 passed with stage
in 29 minutes and 13 seconds
......@@ -22,6 +22,7 @@ using namespace KSieveUi;
AutoCreateScriptDialog::AutoCreateScriptDialog(QWidget *parent)
: QDialog(parent)
, mEditor(new SieveEditorGraphicalModeWidget(this))
{
setWindowTitle(i18nc("@title:window", "Create Sieve Filter"));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
......@@ -32,7 +33,6 @@ AutoCreateScriptDialog::AutoCreateScriptDialog(QWidget *parent)
connect(buttonBox, &QDialogButtonBox::accepted, this, &AutoCreateScriptDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &AutoCreateScriptDialog::reject);
okButton->setFocus();
mEditor = new SieveEditorGraphicalModeWidget(this);
mainLayout->addWidget(mEditor);
mainLayout->addWidget(buttonBox);
readConfig();
......
......@@ -40,7 +40,7 @@ private:
void writeConfig();
private:
SieveEditorGraphicalModeWidget *mEditor = nullptr;
SieveEditorGraphicalModeWidget *const mEditor;
};
}
......
......@@ -56,7 +56,7 @@ QString SelectConvertParameterWidget::code() const
void SelectConvertParameterWidget::initialize()
{
QBoxLayout *hbox = new QHBoxLayout(this);
hbox->setContentsMargins(0, 0, 0, 0);
hbox->setContentsMargins({});
mWidth = new QSpinBox(this);
mWidth->setSuffix(i18n(" px"));
mWidth->setMinimum(1);
......
......@@ -22,7 +22,7 @@ QWidget *SieveActionAbstractFlags::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QHBoxLayout *lay = new QHBoxLayout;
lay->setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins({});
w->setLayout(lay);
SelectFlagsWidget *flagsWidget = new SelectFlagsWidget;
connect(flagsWidget, &SelectFlagsWidget::valueChanged, this, &SieveActionAbstractFlags::valueChanged);
......
......@@ -27,7 +27,7 @@ QWidget *SieveActionAddHeader::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QGridLayout *grid = new QGridLayout;
grid->setContentsMargins(0, 0, 0, 0);
grid->setContentsMargins({});
w->setLayout(grid);
SelectAddHeaderPositionCombobox *combo = new SelectAddHeaderPositionCombobox;
......
......@@ -25,7 +25,7 @@ QWidget *SieveActionBreak::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QHBoxLayout *lay = new QHBoxLayout;
lay->setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins({});
w->setLayout(lay);
QLabel *lab = new QLabel(i18n("Name (optional):"));
......
......@@ -25,7 +25,7 @@ QWidget *SieveActionConvert::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QGridLayout *lay = new QGridLayout;
lay->setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins({});
w->setLayout(lay);
QLabel *lab = new QLabel(i18n("From:"));
......
......@@ -28,7 +28,7 @@ QWidget *SieveActionDeleteHeader::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QGridLayout *grid = new QGridLayout;
grid->setContentsMargins(0, 0, 0, 0);
grid->setContentsMargins({});
w->setLayout(grid);
SelectMatchTypeComboBox *matchType = new SelectMatchTypeComboBox(mSieveGraphicalModeWidget);
......
......@@ -26,7 +26,7 @@ QWidget *SieveActionEnclose::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QGridLayout *grid = new QGridLayout;
grid->setContentsMargins(0, 0, 0, 0);
grid->setContentsMargins({});
w->setLayout(grid);
QLabel *lab = new QLabel(i18n("Subject:"));
......
......@@ -25,7 +25,7 @@ QWidget *SieveActionEReject::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QHBoxLayout *lay = new QHBoxLayout;
lay->setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins({});
w->setLayout(lay);
QLabel *lab = new QLabel(i18n("text:"));
lay->addWidget(lab);
......
......@@ -25,7 +25,7 @@ QWidget *SieveActionExtractText::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QGridLayout *grid = new QGridLayout;
grid->setContentsMargins(0, 0, 0, 0);
grid->setContentsMargins({});
w->setLayout(grid);
QLabel *lab = new QLabel(i18n("Number of characters:"));
......
......@@ -90,7 +90,7 @@ QWidget *SieveActionFileInto::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QHBoxLayout *lay = new QHBoxLayout(w);
lay->setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins({});
if (mHasCopySupport) {
QCheckBox *copy = new QCheckBox(i18n("Keep a copy"));
......
......@@ -49,7 +49,7 @@ QWidget *SieveActionKeep::createParamWidget(QWidget *parent) const
if (mHasFlagSupport) {
QWidget *w = new QWidget(parent);
QHBoxLayout *lay = new QHBoxLayout;
lay->setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins({});
w->setLayout(lay);
QLabel *addFlags = new QLabel(i18n("Add flags:"));
lay->addWidget(addFlags);
......
......@@ -27,7 +27,7 @@ QWidget *SieveActionNotify::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QHBoxLayout *lay = new QHBoxLayout;
lay->setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins({});
w->setLayout(lay);
SelectImportanceCombobox *importanceCombobox = new SelectImportanceCombobox;
......
......@@ -29,7 +29,7 @@ QWidget *SieveActionRedirect::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QHBoxLayout *lay = new QHBoxLayout;
lay->setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins({});
w->setLayout(lay);
if (mHasCopySupport) {
QCheckBox *copy = new QCheckBox(i18n("Keep a copy"));
......
......@@ -25,7 +25,7 @@ QWidget *SieveActionReject::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QHBoxLayout *lay = new QHBoxLayout;
lay->setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins({});
w->setLayout(lay);
QLabel *lab = new QLabel(i18n("text:"));
lay->addWidget(lab);
......
......@@ -28,7 +28,7 @@ QWidget *SieveActionReplace::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QGridLayout *grid = new QGridLayout;
grid->setContentsMargins(0, 0, 0, 0);
grid->setContentsMargins({});
w->setLayout(grid);
QLabel *lab = new QLabel(i18n("Subject:"));
......
......@@ -29,7 +29,7 @@ QWidget *SieveActionSetVariable::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QGridLayout *grid = new QGridLayout;
grid->setContentsMargins(0, 0, 0, 0);
grid->setContentsMargins({});
w->setLayout(grid);
SelectVariableModifierComboBox *modifier = new SelectVariableModifierComboBox;
......
......@@ -32,7 +32,7 @@ QWidget *SieveActionVacation::createParamWidget(QWidget *parent) const
{
QWidget *w = new QWidget(parent);
QGridLayout *grid = new QGridLayout;
grid->setContentsMargins(0, 0, 0, 0);
grid->setContentsMargins({});
w->setLayout(grid);
QLabel *lab = nullptr;
......
......@@ -14,7 +14,7 @@ AddressLineEdit::AddressLineEdit(QWidget *parent)
: AbstractSelectEmailLineEdit(parent)
{
QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setContentsMargins({});
mLineEdit = new QLineEdit(this);
mainLayout->addWidget(mLineEdit);
mLineEdit->setClearButtonEnabled(true);
......
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