Commit 8b9fda38 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify pointer here too

parent cec9b27f
Pipeline #76045 failed with stage
in 2 minutes and 39 seconds
......@@ -27,6 +27,7 @@ using namespace std::chrono_literals;
ArchiveMailAgent::ArchiveMailAgent(const QString &id)
: Akonadi::AgentBase(id)
, mTimer(new QTimer(this))
, mArchiveManager(new ArchiveMailManager(this))
{
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(6, 0, 0)
......@@ -62,7 +63,6 @@ ArchiveMailAgent::ArchiveMailAgent(const QString &id)
#endif
}
mTimer = new QTimer(this);
connect(mTimer, &QTimer::timeout, this, &ArchiveMailAgent::reload);
mTimer->start(24h);
}
......
......@@ -41,7 +41,7 @@ protected:
private:
void mailCollectionRemoved(const Akonadi::Collection &collection);
QTimer *mTimer = nullptr;
QTimer *const mTimer;
ArchiveMailManager *const mArchiveManager;
};
......@@ -33,6 +33,7 @@ using namespace std::chrono_literals;
FollowUpReminderAgent::FollowUpReminderAgent(const QString &id)
: Akonadi::AgentBase(id)
, mManager(new FollowUpReminderManager(this))
, mTimer(new QTimer(this))
{
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(6, 0, 0)
Kdelibs4ConfigMigrator migrate(QStringLiteral("followupreminderagent"));
......@@ -59,7 +60,6 @@ FollowUpReminderAgent::FollowUpReminderAgent(const QString &id)
mManager->load();
}
mTimer = new QTimer(this);
connect(mTimer, &QTimer::timeout, this, &FollowUpReminderAgent::reload);
// Reload all each 24hours
mTimer->start(24h);
......
......@@ -35,6 +35,6 @@ protected:
private:
FollowUpReminderManager *const mManager;
QTimer *mTimer = nullptr;
QTimer *const mTimer;
};
......@@ -17,8 +17,8 @@ static const char myConfigGroupName[] = "FollowUpReminderInfoDialog";
FollowUpReminderInfoConfigWidget::FollowUpReminderInfoConfigWidget(const KSharedConfigPtr &config, QWidget *parent, const QVariantList &args)
: Akonadi::AgentConfigurationBase(config, parent, args)
, mWidget(new FollowUpReminderInfoWidget(parent))
{
mWidget = new FollowUpReminderInfoWidget(parent);
parent->layout()->addWidget(mWidget);
KAboutData aboutData = KAboutData(QStringLiteral("followupreminderagent"),
......
......@@ -24,6 +24,6 @@ public:
void saveDialogSize(const QSize &size) override;
private:
FollowUpReminderInfoWidget *mWidget = nullptr;
FollowUpReminderInfoWidget *const mWidget;
};
AKONADI_AGENTCONFIG_FACTORY(FollowUpReminderInfoAgentConfigFactory, "followupreminderagentconfig.json", FollowUpReminderInfoConfigWidget)
......@@ -50,11 +50,11 @@ FollowUpReminder::FollowUpReminderInfo *FollowUpReminderInfoItem::info() const
FollowUpReminderInfoWidget::FollowUpReminderInfoWidget(QWidget *parent)
: QWidget(parent)
, mTreeWidget(new QTreeWidget(this))
{
setObjectName(QStringLiteral("FollowUpReminderInfoWidget"));
auto hbox = new QHBoxLayout(this);
hbox->setContentsMargins({});
mTreeWidget = new QTreeWidget(this);
mTreeWidget->setObjectName(QStringLiteral("treewidget"));
QStringList headers;
headers << i18n("To") << i18n("Subject") << i18n("Dead Line") << i18n("Answer")
......
......@@ -65,6 +65,6 @@ private:
AnswerMessageId,
};
QList<qint32> mListRemoveId;
QTreeWidget *mTreeWidget = nullptr;
QTreeWidget *const mTreeWidget;
bool mChanged = false;
};
......@@ -30,6 +30,7 @@ static constexpr const char DialogGroup[] = "FollowUpReminderNoAnswerDialog";
FollowUpReminderNoAnswerDialog::FollowUpReminderNoAnswerDialog(QWidget *parent)
: QDialog(parent)
, mWidget(new FollowUpReminderInfoWidget(this))
{
setWindowTitle(i18nc("@title:window", "Follow Up Reminder"));
setWindowIcon(QIcon::fromTheme(QStringLiteral("kmail")));
......@@ -39,7 +40,6 @@ FollowUpReminderNoAnswerDialog::FollowUpReminderNoAnswerDialog(QWidget *parent)
auto lab = new QLabel(i18n("You still wait an answer about this mail:"), this);
mainLayout->addWidget(lab);
mWidget = new FollowUpReminderInfoWidget(this);
mWidget->setObjectName(QStringLiteral("FollowUpReminderInfoWidget"));
mainLayout->addWidget(mWidget);
......
......@@ -30,6 +30,6 @@ private:
void slotSave();
void readConfig();
void writeConfig();
FollowUpReminderInfoWidget *mWidget = nullptr;
FollowUpReminderInfoWidget *const mWidget;
};
......@@ -39,13 +39,13 @@ using namespace MailCommon;
FilterLogDialog::FilterLogDialog(QWidget *parent)
: QDialog(parent)
, mUser1Button(new QPushButton(this))
, mUser2Button(new QPushButton(this))
{
setWindowTitle(i18nc("@title:window", "Filter Log Viewer"));
auto mainLayout = new QVBoxLayout(this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
mUser1Button = new QPushButton(this);
buttonBox->addButton(mUser1Button, QDialogButtonBox::ActionRole);
mUser2Button = new QPushButton(this);
buttonBox->addButton(mUser2Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::rejected, this, &FilterLogDialog::reject);
setWindowIcon(QIcon::fromTheme(QStringLiteral("view-filter")));
......
......@@ -69,8 +69,8 @@ private:
QCheckBox *mLogPatternResultBox = nullptr;
QCheckBox *mLogFilterActionBox = nullptr;
QSpinBox *mLogMemLimitSpin = nullptr;
QPushButton *mUser1Button = nullptr;
QPushButton *mUser2Button = nullptr;
QPushButton *const mUser1Button;
QPushButton *const mUser2Button;
bool mIsInitialized = false;
};
......
......@@ -56,6 +56,8 @@ bool MailFilterAgent::isFilterableCollection(const Akonadi::Collection &collecti
MailFilterAgent::MailFilterAgent(const QString &id)
: Akonadi::AgentBase(id)
, m_filterManager(new FilterManager(this))
, mProgressTimer(new QTimer(this))
{
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(6, 0, 0)
Kdelibs4ConfigMigrator migrate(QStringLiteral("mailfilteragent"));
......@@ -68,7 +70,6 @@ MailFilterAgent::MailFilterAgent(const QString &id)
CommonKernel->registerKernelIf(mMailFilterKernel); // register KernelIf early, it is used by the Filter classes
CommonKernel->registerSettingsIf(mMailFilterKernel); // SettingsIf is used in FolderTreeWidget
m_filterManager = new FilterManager(this);
connect(m_filterManager, &FilterManager::percent, this, &MailFilterAgent::emitProgress);
connect(m_filterManager, &FilterManager::progressMessage, this, &MailFilterAgent::emitProgressMessage);
......@@ -115,8 +116,6 @@ MailFilterAgent::MailFilterAgent(const QString &id)
changeRecorder()->fetchCollection(true);
changeRecorder()->setChangeRecordingEnabled(false);
mProgressCounter = 0;
mProgressTimer = new QTimer(this);
connect(mProgressTimer, &QTimer::timeout, this, [this]() {
emitProgress();
});
......
......@@ -70,12 +70,12 @@ public Q_SLOTS:
private:
bool isFilterableCollection(const Akonadi::Collection &collection) const;
FilterManager *m_filterManager = nullptr;
FilterManager *const m_filterManager;
FilterLogDialog *m_filterLogDialog = nullptr;
QTimer *mProgressTimer = nullptr;
QTimer *const mProgressTimer;
DummyKernel *mMailFilterKernel = nullptr;
int mProgressCounter;
int mProgressCounter = 0;
Akonadi::Monitor *itemMonitor = nullptr;
void filterItem(const Akonadi::Item &item, const Akonadi::Collection &collection);
......
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