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

Modernize code

parent 742c3efd
Pipeline #37609 passed with stage
in 44 minutes and 57 seconds
......@@ -49,9 +49,9 @@ FollowUpReminderSelectDateDialog::FollowUpReminderSelectDateDialog(QWidget *pare
topLayout->addWidget(mainWidget);
topLayout->addWidget(buttonBox);
QVBoxLayout *mainLayout = new QVBoxLayout(mainWidget);
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setContentsMargins({});
QFormLayout *formLayout = new QFormLayout;
formLayout->setContentsMargins(0, 0, 0, 0);
formLayout->setContentsMargins({});
mainLayout->addLayout(formLayout);
d->mDateComboBox = new KDateComboBox;
......
......@@ -88,7 +88,7 @@ ImageScalingSelectFormat::ImageScalingSelectFormat(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *lay = new QHBoxLayout(this);
lay->setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins({});
mFormat = new QLineEdit;
connect(mFormat, &QLineEdit::textChanged, this, &ImageScalingSelectFormat::textChanged);
mFormat->setReadOnly(true);
......
......@@ -112,7 +112,7 @@ DistributionListDialog::DistributionListDialog(QWidget *parent)
mainLayout->addWidget(buttonBox);
QBoxLayout *topLayout = new QVBoxLayout(topFrame);
topLayout->setContentsMargins(0, 0, 0, 0);
topLayout->setContentsMargins({});
QBoxLayout *titleLayout = new QHBoxLayout;
topLayout->addLayout(titleLayout);
......
......@@ -60,7 +60,7 @@ RecipientLineNG::RecipientLineNG(QWidget *parent)
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
QBoxLayout *topLayout = new QHBoxLayout(this);
topLayout->setContentsMargins(0, 0, 0, 0);
topLayout->setContentsMargins({});
const QStringList recipientTypes = Recipient::allTypeLabels();
......
......@@ -28,7 +28,7 @@ RecipientsEditorSideWidget::RecipientsEditorSideWidget(RecipientsEditor *view, Q
{
QBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->setContentsMargins(0, 0, 0, 0);
topLayout->setContentsMargins({});
topLayout->addStretch(1);
mTotalLabel = new QLabel(this);
......
......@@ -35,7 +35,7 @@ SendLaterDialog::SendLaterDialog(SendLaterInfo *info, QWidget *parent)
QWidget *w = new QWidget(this);
QVBoxLayout *lay = new QVBoxLayout(w);
lay->setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins({});
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
mOkButton = buttonBox->button(QDialogButtonBox::Ok);
......
......@@ -19,7 +19,7 @@ SendLaterTimeDateWidget::SendLaterTimeDateWidget(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *lay = new QHBoxLayout(this);
lay->setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins({});
QDateTime t = QDateTime::currentDateTime();
t = t.addSecs(60 * 60);
......
......@@ -123,7 +123,7 @@ Widget::Widget(QWidget *pParent)
setObjectName(QStringLiteral("messagelistwidget"));
QVBoxLayout *g = new QVBoxLayout(this);
g->setContentsMargins(0, 0, 0, 0);
g->setContentsMargins({});
g->setSpacing(0);
d->quickSearchLine = new QuickSearchLine;
......
......@@ -23,12 +23,12 @@ QuickSearchLine::QuickSearchLine(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *vbox = new QVBoxLayout(this);
vbox->setContentsMargins(0, 0, 0, 0);
vbox->setContentsMargins({});
vbox->setSpacing(0);
QWidget *w = new QWidget;
QHBoxLayout *hbox = new QHBoxLayout(w);
hbox->setContentsMargins(0, 0, 0, 0);
hbox->setContentsMargins({});
hbox->setSpacing(0);
vbox->addWidget(w);
......
......@@ -103,7 +103,7 @@ ConfigureAggregationsDialog::ConfigureAggregationsDialog(QWidget *parent)
mainLayout->addWidget(buttonBox);
QGridLayout *g = new QGridLayout(base);
g->setContentsMargins(0, 0, 0, 0);
g->setContentsMargins({});
d->mAggregationList = new AggregationListWidget(base);
d->mAggregationList->setSelectionMode(QAbstractItemView::ExtendedSelection);
......
......@@ -98,7 +98,7 @@ ConfigureThemesDialog::ConfigureThemesDialog(QWidget *parent)
mainLayout->addWidget(buttonBox);
QGridLayout *g = new QGridLayout(base);
g->setContentsMargins(0, 0, 0, 0);
g->setContentsMargins({});
d->mThemeList = new ThemeListWidget(base);
d->mThemeList->setSelectionMode(QAbstractItemView::ExtendedSelection);
......
......@@ -23,7 +23,7 @@ DKIMManagerKeyWidget::DKIMManagerKeyWidget(QWidget *parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setContentsMargins({});
mTreeWidget = new QTreeWidget(this);
mTreeWidget->setObjectName(QStringLiteral("treewidget"));
......
......@@ -58,7 +58,7 @@ DKIMManageRulesWidget::DKIMManageRulesWidget(QWidget *parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setContentsMargins({});
mTreeWidget = new QTreeWidget(this);
mTreeWidget->setObjectName(QStringLiteral("treewidget"));
......
......@@ -19,7 +19,7 @@ DKIMRuleWidget::DKIMRuleWidget(QWidget *parent)
{
QFormLayout *layout = new QFormLayout(this);
layout->setObjectName(QStringLiteral("layout"));
layout->setContentsMargins(0, 0, 0, 0);
layout->setContentsMargins({});
mEnabled = new QCheckBox(i18n("Enabled"), this);
mEnabled->setObjectName(QStringLiteral("enabled"));
......
......@@ -20,7 +20,7 @@ DKIMWidgetInfo::DKIMWidgetInfo(QWidget *parent)
{
QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setContentsMargins({});
mLabel = new QLabel(this);
mLabel->setAutoFillBackground(true);
......
......@@ -1398,7 +1398,7 @@ void ViewerPrivate::createWidgets()
//TODO: Make a MDN bar similar to Mozillas password bar and show MDNs here as soon as a
// MDN enabled message is shown.
QVBoxLayout *vlay = new QVBoxLayout(q);
vlay->setContentsMargins(0, 0, 0, 0);
vlay->setContentsMargins({});
mSplitter = new QSplitter(Qt::Vertical, q);
connect(mSplitter, &QSplitter::splitterMoved, this, &ViewerPrivate::saveSplitterSizes);
mSplitter->setObjectName(QStringLiteral("mSplitter"));
......@@ -1412,13 +1412,13 @@ void ViewerPrivate::createWidgets()
mBox = new QWidget(mSplitter);
QHBoxLayout *mBoxHBoxLayout = new QHBoxLayout(mBox);
mBoxHBoxLayout->setContentsMargins(0, 0, 0, 0);
mBoxHBoxLayout->setContentsMargins({});
mColorBar = new HtmlStatusBar(mBox);
mBoxHBoxLayout->addWidget(mColorBar);
QWidget *readerBox = new QWidget(mBox);
QVBoxLayout *readerBoxVBoxLayout = new QVBoxLayout(readerBox);
readerBoxVBoxLayout->setContentsMargins(0, 0, 0, 0);
readerBoxVBoxLayout->setContentsMargins({});
mBoxHBoxLayout->addWidget(readerBox);
mColorBar->setObjectName(QStringLiteral("mColorBar"));
......
......@@ -29,7 +29,7 @@ ViewerPluginTest::ViewerPluginTest(QWidget *parent)
QWidget *toolManagerWidget = new QWidget(this);
vbox->addWidget(toolManagerWidget);
vbox = new QVBoxLayout;
vbox->setContentsMargins(0, 0, 0, 0);
vbox->setContentsMargins({});
vbox->setSpacing(0);
toolManagerWidget->setLayout(vbox);
MessageViewer::ViewerPluginToolManager *toolManager
......
......@@ -21,7 +21,7 @@ void ShowNextMessageWidgetTest::shouldHaveDefaultValue()
QHBoxLayout *mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
//mainLayout->setContentsMargins(0, 0, 0, 0);
//mainLayout->setContentsMargins({});
QPushButton *mPreviousMessage = w.findChild<QPushButton *>(QStringLiteral("previous_message"));
QVERIFY(mPreviousMessage);
......
......@@ -40,7 +40,7 @@ ConfigureWidget::ConfigureWidget(QWidget *parent)
{
d->mSettingsUi = new Ui_Settings;
d->mSettingsUi->setupUi(this);
layout()->setContentsMargins(0, 0, 0, 0);
layout()->setContentsMargins({});
QStringList encodings = MimeTreeParser::NodeHelper::supportedEncodings(false);
encodings.prepend(i18n("Auto"));
......
......@@ -15,7 +15,7 @@ DeveloperToolWidget::DeveloperToolWidget(QWidget *parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setContentsMargins({});
mWebEngineView = new QWebEngineView(this);
mWebEngineView->setObjectName(QStringLiteral("mWebEngineView"));
......
......@@ -39,7 +39,7 @@ MailSourceViewTextBrowserWidget::MailSourceViewTextBrowserWidget(const QString &
: QWidget(parent)
{
QVBoxLayout *lay = new QVBoxLayout(this);
lay->setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins({});
mTextToSpeechWidget = new KPIMTextEdit::TextToSpeechWidget;
mTextToSpeechWidget->setObjectName(QStringLiteral("texttospeech"));
lay->addWidget(mTextToSpeechWidget);
......
......@@ -15,7 +15,7 @@ ShowNextMessageWidget::ShowNextMessageWidget(QWidget *parent)
{
QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setContentsMargins({});
mPreviousMessage = new QPushButton(i18n("Previous Message"), this);
mPreviousMessage->setObjectName(QStringLiteral("previous_message"));
......
......@@ -18,7 +18,7 @@ TemplateParserEmailAddressRequesterInterfaceWidget::TemplateParserEmailAddressRe
{
QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setContentsMargins({});
initializeEmailWidget();
mainLayout->addWidget(mTemplateParserEmailBase);
}
......
......@@ -14,7 +14,7 @@ TemplateParserEmailAddressRequesterLineEdit::TemplateParserEmailAddressRequester
{
QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setContentsMargins({});
mLineEdit = new QLineEdit(this);
mLineEdit->setObjectName(QStringLiteral("lineedit"));
mainLayout->addWidget(mLineEdit);
......
......@@ -27,7 +27,7 @@ FindBarBase::FindBarBase(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *lay = new QHBoxLayout(this);
lay->setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins({});
QToolButton *closeBtn = new QToolButton(this);
closeBtn->setIcon(QIcon::fromTheme(QStringLiteral("dialog-close")));
......
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