Commit 3f991c3e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Modernize code

parent 2314536d
Pipeline #32627 canceled with stage
......@@ -26,8 +26,8 @@ private:
void slotBackupDone(const QString &info);
void slotError(const QString &error);
QString mDefaultIconName;
ArchiveMailInfo *mInfo = nullptr;
ArchiveMailManager *mManager = nullptr;
ArchiveMailInfo *const mInfo;
ArchiveMailManager *const mManager;
};
/// A scheduled "expire mails in this folder" task.
......
......@@ -29,7 +29,6 @@ inline QString followUpItemPattern()
FollowUpReminderInfoItem::FollowUpReminderInfoItem(QTreeWidget *parent)
: QTreeWidgetItem(parent)
, mInfo(nullptr)
{
}
......
......@@ -40,7 +40,6 @@ using namespace MailCommon;
FilterLogDialog::FilterLogDialog(QWidget *parent)
: QDialog(parent)
, mIsInitialized(false)
{
setWindowTitle(i18nc("@title:window", "Filter Log Viewer"));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
......
......@@ -42,10 +42,6 @@ class FilterManager::Private
public:
Private(FilterManager *qq)
: q(qq)
, mRequiredPartsBasedOnAll(SearchRule::Envelope)
, mTotalProgressCount(0)
, mCurrentProgressCount(0)
, mInboundFiltersExist(false)
{
}
......@@ -62,10 +58,10 @@ public:
void endFiltering(const Akonadi::Item &item) const;
bool atLeastOneFilterAppliesTo(const QString &accountId) const;
bool atLeastOneIncomingFilterAppliesTo(const QString &accountId) const;
FilterManager *q;
FilterManager *const q;
QVector<MailCommon::MailFilter *> mFilters;
QMap<QString, SearchRule::RequiredPart> mRequiredParts;
SearchRule::RequiredPart mRequiredPartsBasedOnAll;
SearchRule::RequiredPart mRequiredPartsBasedOnAll = SearchRule::Envelope;
int mTotalProgressCount = 0;
int mCurrentProgressCount = 0;
bool mInboundFiltersExist = false;
......
......@@ -51,7 +51,6 @@ bool MailFilterAgent::isFilterableCollection(const Akonadi::Collection &collecti
MailFilterAgent::MailFilterAgent(const QString &id)
: Akonadi::AgentBase(id)
, m_filterLogDialog(nullptr)
{
Kdelibs4ConfigMigrator migrate(QStringLiteral("mailfilteragent"));
migrate.setConfigFiles(QStringList() << QStringLiteral("akonadi_mailfilter_agentrc") << QStringLiteral("akonadi_mailfilter_agent.notifyrc"));
......
......@@ -35,7 +35,6 @@
SendLaterAgent::SendLaterAgent(const QString &id)
: Akonadi::AgentBase(id)
, mAgentInitialized(false)
{
Kdelibs4ConfigMigrator migrate(QStringLiteral("sendlateragent"));
migrate.setConfigFiles(QStringList() << QStringLiteral("akonadi_sendlater_agentrc") << QStringLiteral("akonadi_sendlater_agent.notifyrc"));
......
......@@ -44,7 +44,7 @@ protected:
private:
void slotSendNow(Akonadi::Item::Id id);
void slotStartAgent();
bool mAgentInitialized;
bool mAgentInitialized = false;
SendLaterManager *mManager = nullptr;
};
......
......@@ -36,8 +36,8 @@ private:
void slotDeleteItem(KJob *);
void updateAndCleanMessageBeforeSending(const KMime::Message::Ptr &msg);
Akonadi::ItemFetchScope mFetchScope;
SendLaterManager *mManager = nullptr;
MessageComposer::SendLaterInfo *mInfo = nullptr;
SendLaterManager *const mManager;
MessageComposer::SendLaterInfo *const mInfo;
Akonadi::Item mItem;
};
......
......@@ -69,7 +69,7 @@ private:
MessageComposer::SendLaterInfo *mCurrentInfo = nullptr;
SendLaterJob *mCurrentJob = nullptr;
QTimer *mTimer = nullptr;
MessageComposer::AkonadiSender *mSender = nullptr;
MessageComposer::AkonadiSender *const mSender;
QQueue<Akonadi::Item::Id> mSendLaterQueue;
};
......
......@@ -11,7 +11,6 @@
SendLaterRemoveMessageJob::SendLaterRemoveMessageJob(const QVector<Akonadi::Item::Id> &listItem, QObject *parent)
: QObject(parent)
, mListItems(listItem)
, mIndex(0)
{
}
......
......@@ -26,7 +26,7 @@ private:
void slotItemDeleteDone(KJob *job);
void deleteItem();
QVector<Akonadi::Item::Id> mListItems;
int mIndex;
int mIndex = 0;
};
#endif // SENDLATERREMOVEMESSAGEJOB_H
......@@ -31,7 +31,7 @@ private:
void writeConfig();
QStandardItemModel *mBoxModel = nullptr;
UnifiedMailboxManager &mBoxManager;
MailKernel *mKernel = nullptr;
MailKernel *const mKernel;
KSharedConfigPtr mConfig;
};
......
......@@ -23,7 +23,7 @@ public:
private:
void writeConfig();
void readConfig();
UnifiedMailbox *mMailbox = nullptr;
UnifiedMailbox *const mMailbox;
KSharedConfigPtr mConfig;
};
......
......@@ -42,8 +42,8 @@ private:
void doubleClicked(const QModelIndex &itemClicked);
void slotSelectAllAttachment();
KMComposerWin *mComposer = nullptr;
AttachmentView *mView = nullptr;
KMComposerWin *const mComposer;
AttachmentView *const mView;
};
} // namespace KMail
......
......@@ -36,7 +36,7 @@ protected:
void insertFromMimeData(const QMimeData *source) override;
private:
KMComposerWin *mComposerWin = nullptr;
KMComposerWin *const mComposerWin;
};
#endif // KMCOMPOSEREDITORNG_H
......@@ -27,7 +27,7 @@ public Q_SLOTS:
void slotInsertText(const QString &str);
private:
Q_DISABLE_COPY(KMComposerGlobalAction)
KMComposerWin *mComposerWin = nullptr;
KMComposerWin *const mComposerWin;
};
#endif // KMCOMPOSERGLOBALACTION_H
......@@ -18,8 +18,8 @@ public:
Q_REQUIRED_RESULT bool validate();
private:
QWidget *mParent = nullptr;
KActionCollection *mActionCollection = nullptr;
QWidget *const mParent;
KActionCollection *const mActionCollection;
};
#endif // VALIDATESENDMAILSHORTCUT_H
......@@ -29,7 +29,7 @@ private:
void slotCreateNewFolder(KJob *);
void createNewFolder(const QString &name);
QDate mCurrentDate;
FolderArchiveAccountInfo *mInfo = nullptr;
FolderArchiveAccountInfo *const mInfo;
};
#endif // FOLDERARCHIVEAGENTCHECKCOLLECTION_H
......@@ -31,8 +31,8 @@ private:
void sendError(const QString &error);
Akonadi::Item::List mListItem;
FolderArchiveManager *mManager = nullptr;
FolderArchiveAccountInfo *mInfo = nullptr;
FolderArchiveManager *const mManager;
FolderArchiveAccountInfo *const mInfo;
};
#endif // FOLDERARCHIVEAGENTJOB_H
......@@ -25,8 +25,8 @@
FolderArchiveManager::FolderArchiveManager(QObject *parent)
: QObject(parent)
, mFolderArchiveCache(new FolderArchiveCache(this))
{
mFolderArchiveCache = new FolderArchiveCache(this);
load();
}
......
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