Commit 8007229a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify pointer

parent 7a77082e
Pipeline #59777 canceled with stage
......@@ -15,6 +15,7 @@
#include <QVBoxLayout>
CollectionQuotaPage::CollectionQuotaPage(QWidget *parent)
: CollectionPropertiesPage(parent)
, mQuotaWidget(new CollectionQuotaWidget(this))
{
setObjectName(QStringLiteral("KMail::CollectionQuotaPage"));
setPageTitle(i18n("Quota"));
......@@ -35,7 +36,6 @@ bool CollectionQuotaPage::canHandle(const Akonadi::Collection &collection) const
void CollectionQuotaPage::init()
{
auto topLayout = new QVBoxLayout(this);
mQuotaWidget = new CollectionQuotaWidget(this);
topLayout->addWidget(mQuotaWidget);
}
......
......@@ -25,7 +25,7 @@ public:
private:
void init();
CollectionQuotaWidget *mQuotaWidget = nullptr;
CollectionQuotaWidget *const mQuotaWidget;
};
AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CollectionQuotaPageFactory, CollectionQuotaPage)
......
......@@ -23,6 +23,7 @@ using namespace MailCommon;
CollectionShortcutPage::CollectionShortcutPage(QWidget *parent)
: CollectionPropertiesPage(parent)
, mKeySeqWidget(new KKeySequenceWidget(this))
{
setObjectName(QStringLiteral("KMail::CollectionShortcutPage"));
setPageTitle(i18nc("@title:tab Shortcut settings for a folder.", "Shortcut"));
......@@ -47,7 +48,6 @@ void CollectionShortcutPage::init(const Akonadi::Collection &col)
auto hbHBoxLayout = new QHBoxLayout;
mKeySeqWidget = new KKeySequenceWidget(this);
hbHBoxLayout->addWidget(mKeySeqWidget);
mKeySeqWidget->setObjectName(QStringLiteral("FolderShortcutSelector"));
connect(mKeySeqWidget, &KKeySequenceWidget::keySequenceChanged, this, &CollectionShortcutPage::slotShortcutChanged);
......
......@@ -31,7 +31,7 @@ private:
void init(const Akonadi::Collection &);
QSharedPointer<MailCommon::FolderSettings> mFolder;
Akonadi::Collection mCurrentCollection;
KKeySequenceWidget *mKeySeqWidget = nullptr;
KKeySequenceWidget *const mKeySeqWidget;
bool mShortcutChanged = false;
};
......
......@@ -20,6 +20,7 @@ using namespace MailCommon;
CollectionTemplatesPage::CollectionTemplatesPage(QWidget *parent)
: CollectionPropertiesPage(parent)
, mCollectionTemplateWidget(new MailCommon::CollectionTemplatesWidget(this))
{
setObjectName(QStringLiteral("KMail::CollectionTemplatesPage"));
setPageTitle(i18n("Templates"));
......@@ -37,7 +38,6 @@ void CollectionTemplatesPage::init()
{
auto topLayout = new QVBoxLayout(this);
topLayout->setContentsMargins({});
mCollectionTemplateWidget = new MailCommon::CollectionTemplatesWidget(this);
topLayout->addWidget(mCollectionTemplateWidget);
}
......
......@@ -25,7 +25,7 @@ public:
private:
void init();
MailCommon::CollectionTemplatesWidget *mCollectionTemplateWidget = nullptr;
MailCommon::CollectionTemplatesWidget *const mCollectionTemplateWidget;
};
AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CollectionTemplatesPageFactory, CollectionTemplatesPage)
......
......@@ -18,10 +18,10 @@
ConfigModuleWithTabs::ConfigModuleWithTabs(QWidget *parent)
: ConfigModule(parent)
, mTabWidget(new QTabWidget(this))
{
auto vlay = new QVBoxLayout(this);
vlay->setContentsMargins({});
mTabWidget = new QTabWidget(this);
vlay->addWidget(mTabWidget);
}
......
......@@ -75,7 +75,7 @@ protected:
void addTab(ConfigModuleTab *tab, const QString &title);
private:
QTabWidget *mTabWidget = nullptr;
QTabWidget *const mTabWidget;
bool mWasInitialized = false;
};
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