Modernize code

wilder
Laurent Montel 6 years ago
parent 2314536d0c
commit 3f991c3e2d
  1. 4
      agents/archivemailagent/job/archivejob.h
  2. 1
      agents/followupreminderagent/followupreminderinfowidget.cpp
  3. 1
      agents/mailfilteragent/filterlogdialog.cpp
  4. 8
      agents/mailfilteragent/filtermanager.cpp
  5. 1
      agents/mailfilteragent/mailfilteragent.cpp
  6. 1
      agents/sendlateragent/sendlateragent.cpp
  7. 2
      agents/sendlateragent/sendlateragent.h
  8. 4
      agents/sendlateragent/sendlaterjob.h
  9. 2
      agents/sendlateragent/sendlatermanager.h
  10. 1
      agents/sendlateragent/sendlaterremovemessagejob.cpp
  11. 2
      agents/sendlateragent/sendlaterremovemessagejob.h
  12. 2
      agents/unifiedmailboxagent/settingsdialog.h
  13. 2
      agents/unifiedmailboxagent/unifiedmailboxeditor.h
  14. 4
      src/editor/attachment/attachmentcontroller.h
  15. 2
      src/editor/kmcomposereditorng.h
  16. 2
      src/editor/kmcomposerglobalaction.h
  17. 4
      src/editor/validatesendmailshortcut.h
  18. 2
      src/folderarchive/folderarchiveagentcheckcollection.h
  19. 4
      src/folderarchive/folderarchiveagentjob.h
  20. 2
      src/folderarchive/folderarchivemanager.cpp
  21. 2
      src/folderarchive/folderarchivemanager.h
  22. 2
      src/foldershortcutactionmanager.h
  23. 1
      src/identity/identitydialog.cpp
  24. 2
      src/identity/newidentitydialog.h
  25. 2
      src/job/addressvalidationjob.h
  26. 2
      src/job/createnewcontactjob.h
  27. 4
      src/job/removeduplicatemailjob.h
  28. 2
      src/job/removeduplicatemessageinfolderandsubfolderjob.h
  29. 2
      src/kmail_part.h
  30. 3
      src/kmlaunchexternalcomponent.h
  31. 2
      src/kmmainwidget.h
  32. 6
      src/main.cpp
  33. 2
      src/search/checkindexingjob.h
  34. 2
      src/search/checkindexingmanager.h
  35. 2
      src/searchdialog/searchwindow.h
  36. 8
      src/tag/tagactionmanager.h
  37. 1
      src/widgets/kactionmenutransport.cpp

@ -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();
}

@ -52,7 +52,7 @@ private:
QQueue<FolderArchiveAgentJob *> mJobQueue;
FolderArchiveAgentJob *mCurrentJob = nullptr;
QList<FolderArchiveAccountInfo *> mListAccountInfo;
FolderArchiveCache *mFolderArchiveCache = nullptr;
FolderArchiveCache *const mFolderArchiveCache;
};
#endif // FOLDERARCHIVEMANAGER_H

@ -39,7 +39,7 @@ Q_SIGNALS:
private:
Q_DISABLE_COPY(FolderShortcutCommand)
Akonadi::Collection mCollectionFolder;
QWidget *mMainWidget = nullptr;
QWidget *const mMainWidget;
QAction *mAction = nullptr;
};

@ -146,7 +146,6 @@ KeyGenerationJob::KeyGenerationJob(const QString &name, const QString &email, Ke
: QGpgME::Job(parent)
, mName(name)
, mEmail(email)
, mJob(nullptr)
{
}

@ -46,7 +46,7 @@ private:
QLineEdit *mLineEdit = nullptr;
QComboBox *mComboBox = nullptr;
QButtonGroup *mButtonGroup = nullptr;
KIdentityManagement::IdentityManager *mIdentityManager = nullptr;
KIdentityManagement::IdentityManager *const mIdentityManager;
QPushButton *mOkButton = nullptr;
};
}

@ -32,7 +32,7 @@ private:
QString mEmailAddresses;
QString mDomainDefaultName;
bool mIsValid = false;
QWidget *mParentWidget = nullptr;
QWidget *const mParentWidget;
};
#endif

@ -45,7 +45,7 @@ private:
void createContact();
QWidget *mParentWidget = nullptr;
QWidget *const mParentWidget;
};
#endif // CREATENEWCONTACTJOB_H

@ -28,8 +28,8 @@ private:
void slotRemoveDuplicatesDone(KJob *job);
void slotRemoveDuplicatesCanceled(KPIM::ProgressItem *item);
void slotRemoveDuplicatesUpdate(KJob *job, const QString &description);
QWidget *mParent = nullptr;
QItemSelectionModel *mSelectionModel = nullptr;
QWidget *const mParent;
QItemSelectionModel *const mSelectionModel;
};
#endif // REMOVEDUPLICATEMAILJOB_H

@ -33,7 +33,7 @@ private:
void slotRemoveDuplicatesUpdate(KJob *job, const QString &description);
void slotRemoveDuplicatesCanceled(KPIM::ProgressItem *item);
Akonadi::Collection mTopLevelCollection;
QWidget *mParentWidget = nullptr;
QWidget *const mParentWidget;
};
#endif // REMOVEDUPLICATEMESSAGEINFOLDERANDSUBFOLDERJOB_H

@ -38,7 +38,7 @@ protected:
private:
KMMainWidget *mainWidget = nullptr;
QWidget *mParentWidget = nullptr;
QWidget *const mParentWidget;
};
#endif

@ -28,8 +28,7 @@ public Q_SLOTS:
void slotFilterLogViewer();
private:
Q_DISABLE_COPY(KMLaunchExternalComponent)
QString akonadiPath(QString service);
QWidget *mParentWidget = nullptr;
QWidget *const mParentWidget;
};
#endif // KMLAUNCHEXTERNALCOMPONENT_H

@ -629,7 +629,7 @@ private:
MessageViewer::Viewer::DisplayFormatMessage mFolderDisplayFormatPreference = MessageViewer::Viewer::UseGlobalSetting;
QAction *mSearchMessages = nullptr;
KMLaunchExternalComponent *mLaunchExternalComponent = nullptr;
ManageShowCollectionProperties *mManageShowCollectionProperties = nullptr;
ManageShowCollectionProperties *const mManageShowCollectionProperties;
QAction *mShowIntroductionAction = nullptr;
QAction *mMarkAllMessageAsReadAndInAllSubFolder = nullptr;
KActionMenuAccount *mAccountActionMenu = nullptr;

@ -36,8 +36,6 @@ class KMailApplication : public KontactInterface::PimUniqueApplication
public:
KMailApplication(int &argc, char **argv[])
: KontactInterface::PimUniqueApplication(argc, argv)
, mDelayedInstanceCreation(false)
, mEventLoopReached(false)
{
}
@ -50,8 +48,8 @@ public Q_SLOTS:
int newInstance(const QByteArray &startupId, const QStringList &arguments, const QString &workingDirectory) override;
protected:
bool mDelayedInstanceCreation;
bool mEventLoopReached;
bool mDelayedInstanceCreation = false;
bool mEventLoopReached = false;
};
void KMailApplication::commitData(QSessionManager &)

@ -36,7 +36,7 @@ private:
void slotCollectionPropertiesFinished(KJob *job);
void askForNextCheck(quint64 id, bool needToReindex = false);
Akonadi::Collection mCollection;
Akonadi::Search::PIM::IndexedItems *mIndexedItems = nullptr;
Akonadi::Search::PIM::IndexedItems *const mIndexedItems;
};
#endif // CHECKINDEXINGJOB_H

@ -37,7 +37,7 @@ private:
void createJob();
void callToReindexCollection();
Akonadi::Search::PIM::IndexedItems *mIndexedItems = nullptr;
Akonadi::Search::PIM::IndexedItems *const mIndexedItems;
Akonadi::Collection::List mListCollection;
QTimer *mTimer = nullptr;
QList<qint64> mCollectionsIndexed;

@ -176,7 +176,7 @@ private:
QTimer mRenameTimer;
QByteArray mHeaderState;
// not owned by us
KMMainWidget *mKMMainWidget = nullptr;
KMMainWidget *const mKMMainWidget;
SearchPatternWarning *mSearchPatternWidget = nullptr;
Akonadi::StandardMailActionManager *mAkonadiStandardAction = nullptr;

@ -102,9 +102,9 @@ private:
void checkTags(const QList<qint64> &tags);
QList<qint64> checkedTags() const;
KActionCollection *mActionCollection = nullptr;
MessageActions *mMessageActions = nullptr;
KXMLGUIClient *mGUIClient = nullptr;
KActionCollection *const mActionCollection;
MessageActions *const mMessageActions;
KXMLGUIClient *const mGUIClient;
QAction *mSeparatorMoreAction = nullptr;
QAction *mSeparatorNewTagAction = nullptr;
@ -123,7 +123,7 @@ private:
// Uri of a newly created tag
qint64 mNewTagId = -1;
bool mTagFetchInProgress = false;
Akonadi::Monitor *mMonitor = nullptr;
Akonadi::Monitor *const mMonitor;
};
}

@ -10,7 +10,6 @@
KActionMenuTransport::KActionMenuTransport(QObject *parent)
: KActionMenu(parent)
, mInitialized(false)
{
setDelayed(true);
connect(MailTransport::TransportManager::self(), &MailTransport::TransportManager::transportsChanged, this, &KActionMenuTransport::updateTransportMenu);

Loading…
Cancel
Save