Commit 06ae9ac5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify pointer + use {}

parent d4a00d22
Pipeline #90264 passed with stage
in 11 minutes and 20 seconds
......@@ -20,12 +20,12 @@
using namespace PimCommon;
ConfigurePluginsListWidget::ConfigurePluginsListWidget(QWidget *parent)
: QWidget(parent)
, mListWidget(new QTreeWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setContentsMargins({});
mListWidget = new QTreeWidget(this);
mListWidget->setSortingEnabled(true);
mListWidget->sortItems(0, Qt::AscendingOrder);
mListWidget->setObjectName(QStringLiteral("listwidget"));
......
......@@ -68,7 +68,7 @@ protected:
void resetToUserSettings(const QVector<PluginItem *> &items);
void changeState(const QVector<PluginItem *> &items);
QTreeWidget *mListWidget = nullptr;
QTreeWidget *const mListWidget;
private:
KTreeWidgetSearchLineWidget *mTreeWidgetSearchLineEdit = nullptr;
......
......@@ -38,7 +38,7 @@ ConfigurePluginsWidget::~ConfigurePluginsWidget()
void ConfigurePluginsWidget::initLayout(ConfigurePluginsListWidget *configurePluginListWidget)
{
auto layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->setContentsMargins({});
mMessageWidget = new KMessageWidget(i18n("Restart is necessary for applying the changes."), this);
mMessageWidget->setObjectName(QStringLiteral("mMessageWidget"));
......
......@@ -21,16 +21,16 @@ using namespace PimCommon;
LogActivitiesDialog::LogActivitiesDialog(QWidget *parent)
: QDialog(parent)
, mLogWidget(new LogActivitiesWidget(this))
, mEnableLogActivities(new QCheckBox(i18n("Log activities"), this))
{
setWindowTitle(i18nc("@title:window", "Log activities"));
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mLogWidget = new LogActivitiesWidget(this);
mLogWidget->setObjectName(QStringLiteral("logwidget"));
mainLayout->addWidget(mLogWidget);
mEnableLogActivities = new QCheckBox(i18n("Log activities"), this);
mEnableLogActivities->setObjectName(QStringLiteral("enablelogactivities"));
mainLayout->addWidget(mEnableLogActivities);
connect(mEnableLogActivities, &QCheckBox::toggled, this, &LogActivitiesDialog::slotEnableLogActivities);
......
......@@ -35,9 +35,9 @@ private:
void slotEnableLogActivities(bool state);
void slotActivityTextChanged(bool changed);
LogActivitiesWidget *mLogWidget = nullptr;
LogActivitiesWidget *const mLogWidget;
QPushButton *mClearButton = nullptr;
QCheckBox *mEnableLogActivities = nullptr;
QCheckBox *const mEnableLogActivities;
QPushButton *mSaveButton = nullptr;
QPushButton *mShareButton = nullptr;
};
......
......@@ -12,12 +12,12 @@ using namespace PimCommon;
LogActivitiesWidget::LogActivitiesWidget(QWidget *parent)
: QWidget(parent)
, mLog(new KPIMTextEdit::PlainTextEditorWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setContentsMargins({});
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mLog = new KPIMTextEdit::PlainTextEditorWidget(this);
mLog->setObjectName(QStringLiteral("log"));
mLog->setReadOnly(true);
mainLayout->addWidget(mLog);
......
......@@ -31,7 +31,7 @@ Q_SIGNALS:
private:
void slotTextChanged();
KPIMTextEdit::PlainTextEditorWidget *mLog = nullptr;
KPIMTextEdit::PlainTextEditorWidget *const mLog;
};
}
......@@ -45,7 +45,7 @@ TemplateEditDialog::TemplateEditDialog(QWidget *parent, bool defaultTemplate)
mainLayout->addWidget(buttonBox);
auto vbox = new QVBoxLayout;
vbox->setContentsMargins(0, 0, 0, 0);
vbox->setContentsMargins({});
auto hbox = new QHBoxLayout;
auto label = new QLabel(i18n("Name:"));
......
......@@ -17,6 +17,7 @@
TranslatorDebugDialog::TranslatorDebugDialog(QWidget *parent)
: QDialog(parent)
, mEdit(new KPIMTextEdit::PlainTextEditorWidget(this))
{
setWindowTitle(i18nc("@title:window", "Translator Debug"));
auto mainLayout = new QVBoxLayout(this);
......@@ -29,7 +30,6 @@ TranslatorDebugDialog::TranslatorDebugDialog(QWidget *parent)
mUser1Button->setText(i18n("Save As..."));
connect(mUser1Button, &QPushButton::clicked, this, &TranslatorDebugDialog::slotSaveAs);
mEdit = new KPIMTextEdit::PlainTextEditorWidget(this);
mEdit->setReadOnly(true);
mainLayout->addWidget(mEdit);
mainLayout->addWidget(buttonBox);
......
......@@ -25,7 +25,7 @@ private:
void slotSaveAs();
void readConfig();
void writeConfig();
KPIMTextEdit::PlainTextEditorWidget *mEdit = nullptr;
KPIMTextEdit::PlainTextEditorWidget *const mEdit;
QPushButton *mUser1Button = nullptr;
};
......@@ -204,7 +204,7 @@ void TranslatorWidget::init()
connect(d->abstractTranslator, &PimCommon::GoogleTranslator::translateFailed, this, &TranslatorWidget::slotTranslateFailed);
auto layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->setContentsMargins({});
auto hboxLayout = new QHBoxLayout;
auto closeBtn = new QToolButton(this);
closeBtn->setObjectName(QStringLiteral("close-button"));
......
......@@ -15,9 +15,9 @@ using namespace PimCommon;
#define MAX_COMPLETION_ITEMS 20
LineEditWithCompleterNg::LineEditWithCompleterNg(QWidget *parent)
: QLineEdit(parent)
, mCompleterListModel(new QStringListModel(this))
{
auto completer = new QCompleter(this);
mCompleterListModel = new QStringListModel(this);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setModel(mCompleterListModel);
setCompleter(completer);
......
......@@ -31,7 +31,7 @@ public Q_SLOTS:
void slotClearHistory();
private:
QStringListModel *mCompleterListModel = nullptr;
QStringListModel *const mCompleterListModel;
QStringList mListCompetion;
};
}
......@@ -73,7 +73,7 @@ SimpleStringListEditor::SimpleStringListEditor(QWidget *parent,
setAddDialogLabel(addDialogLabel);
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
auto hlay = new QHBoxLayout(this);
hlay->setContentsMargins(0, 0, 0, 0);
hlay->setContentsMargins({});
d->mListBox = new QListWidget(this);
......
......@@ -79,7 +79,7 @@ AclEntryDialog::AclEntryDialog(QWidget *parent)
mainLayout->addWidget(buttonBox);
auto layout = new QGridLayout(page);
layout->setContentsMargins(0, 0, 0, 0);
layout->setContentsMargins({});
auto label = new QLabel(i18n("&User identifier:"), page);
layout->addWidget(label, 0, 0);
......
......@@ -40,7 +40,7 @@ CollectionAclPage::~CollectionAclPage() = default;
void CollectionAclPage::init()
{
auto layout = new QHBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->setContentsMargins({});
d->mCollectionAclWidget = new CollectionAclWidget(this);
layout->addWidget(d->mCollectionAclWidget);
}
......
......@@ -86,7 +86,7 @@ CollectionAclWidget::CollectionAclWidget(QWidget *parent)
auto buttonBox = new QWidget;
auto buttonBoxVBoxLayout = new QVBoxLayout(buttonBox);
buttonBoxVBoxLayout->setContentsMargins(0, 0, 0, 0);
buttonBoxVBoxLayout->setContentsMargins({});
layout->addWidget(buttonBox);
auto button = new ActionButton(buttonBox);
......
......@@ -106,7 +106,7 @@ BlackListBalooEmailCompletionWidget::BlackListBalooEmailCompletionWidget(QWidget
searchLineLayout->addWidget(mSearchInResultLineEdit);
auto excludeDomainLayout = new QHBoxLayout;
excludeDomainLayout->setContentsMargins(0, 0, 0, 0);
excludeDomainLayout->setContentsMargins({});
mainLayout->addLayout(excludeDomainLayout);
auto excludeDomainLabel = new QLabel(i18n("Exclude domain names:"), this);
......
......@@ -235,7 +235,7 @@ CompletionOrderWidget::CompletionOrderWidget(QWidget *parent)
auto page = new QWidget(this);
auto pageHBoxLayout = new QHBoxLayout(page);
pageHBoxLayout->setContentsMargins(0, 0, 0, 0);
pageHBoxLayout->setContentsMargins({});
hbox->addWidget(page);
mListView = new QTreeWidget(page);
mListView->setObjectName(QStringLiteral("listview"));
......@@ -250,7 +250,7 @@ CompletionOrderWidget::CompletionOrderWidget(QWidget *parent)
auto upDownBox = new QWidget(page);
auto upDownBoxVBoxLayout = new QVBoxLayout(upDownBox);
upDownBoxVBoxLayout->setContentsMargins(0, 0, 0, 0);
upDownBoxVBoxLayout->setContentsMargins({});
pageHBoxLayout->addWidget(upDownBox);
mUpButton = new QPushButton(upDownBox);
upDownBoxVBoxLayout->addWidget(mUpButton);
......
......@@ -40,7 +40,7 @@ CheckedCollectionWidget::CheckedCollectionWidget(const QString &mimetype, QWidge
, d(new PimCommon::CheckedCollectionWidgetPrivate)
{
auto vbox = new QVBoxLayout(this);
vbox->setContentsMargins(0, 0, 0, 0);
vbox->setContentsMargins({});
// Create a new change recorder.
auto monitor = new Akonadi::Monitor(this);
......
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