From b32ed13a0e7c9bf8b7060b39a7bf2465429f054a Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Thu, 3 Sep 2020 08:17:27 +0200 Subject: [PATCH] modernize code --- .../src/composer-ng/richtextcomposersignatures.cpp | 2 +- messagecomposer/src/composer/composerviewinterface.cpp | 2 +- messagecomposer/src/composer/composerviewinterface.h | 4 ++-- messagecomposer/src/imagescaling/imagescalingwidget.cpp | 2 +- messagecomposer/src/job/distributionlistexpandjob.h | 2 +- messagecomposer/src/recipient/kwindowpositioner.h | 4 ++-- messagecomposer/src/recipient/recipientseditorsidewidget.h | 2 +- messagecomposer/src/snippet/convertsnippetvariablemenu.h | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/messagecomposer/src/composer-ng/richtextcomposersignatures.cpp b/messagecomposer/src/composer-ng/richtextcomposersignatures.cpp index a72caee4..90a87902 100644 --- a/messagecomposer/src/composer-ng/richtextcomposersignatures.cpp +++ b/messagecomposer/src/composer-ng/richtextcomposersignatures.cpp @@ -22,7 +22,7 @@ public: void cleanWhitespaceHelper(const QRegExp ®Exp, const QString &newText, const KIdentityManagement::Signature &sig); Q_REQUIRED_RESULT QVector > signaturePositions(const KIdentityManagement::Signature &sig) const; - RichTextComposerNg *richTextComposer = nullptr; + RichTextComposerNg *const richTextComposer; }; RichTextComposerSignatures::RichTextComposerSignatures(MessageComposer::RichTextComposerNg *composer, QObject *parent) diff --git a/messagecomposer/src/composer/composerviewinterface.cpp b/messagecomposer/src/composer/composerviewinterface.cpp index 3f935a28..7c20e54e 100644 --- a/messagecomposer/src/composer/composerviewinterface.cpp +++ b/messagecomposer/src/composer/composerviewinterface.cpp @@ -51,7 +51,7 @@ QString ComposerViewInterface::from() const return {}; } -MessageComposer::ComposerAttachmentInterface ComposerViewInterface::attachments() +MessageComposer::ComposerAttachmentInterface ComposerViewInterface::attachments() const { MessageComposer::ComposerAttachmentInterface attachmentInterface; if (mComposerView) { diff --git a/messagecomposer/src/composer/composerviewinterface.h b/messagecomposer/src/composer/composerviewinterface.h index e019cf12..04ef7a92 100644 --- a/messagecomposer/src/composer/composerviewinterface.h +++ b/messagecomposer/src/composer/composerviewinterface.h @@ -27,7 +27,7 @@ public: Q_REQUIRED_RESULT QString cc() const; Q_REQUIRED_RESULT QString from() const; - Q_REQUIRED_RESULT MessageComposer::ComposerAttachmentInterface attachments(); + Q_REQUIRED_RESULT MessageComposer::ComposerAttachmentInterface attachments() const; Q_REQUIRED_RESULT QString shortDate() const; Q_REQUIRED_RESULT QString longDate() const; @@ -35,7 +35,7 @@ public: Q_REQUIRED_RESULT QString longTime() const; Q_REQUIRED_RESULT QString insertDayOfWeek() const; private: - ComposerViewBase *mComposerView = nullptr; + ComposerViewBase *const mComposerView; }; } diff --git a/messagecomposer/src/imagescaling/imagescalingwidget.cpp b/messagecomposer/src/imagescaling/imagescalingwidget.cpp index 8a8781fb..a10abd06 100644 --- a/messagecomposer/src/imagescaling/imagescalingwidget.cpp +++ b/messagecomposer/src/imagescaling/imagescalingwidget.cpp @@ -31,7 +31,7 @@ public: delete ui; } - Ui::ImageScalingWidget *ui = nullptr; + Ui::ImageScalingWidget *const ui; QButtonGroup *mSourceFilenameFilterGroup = nullptr; QButtonGroup *mRecipientFilterGroup = nullptr; bool mWasChanged = false; diff --git a/messagecomposer/src/job/distributionlistexpandjob.h b/messagecomposer/src/job/distributionlistexpandjob.h index 236f5cc5..584494d0 100644 --- a/messagecomposer/src/job/distributionlistexpandjob.h +++ b/messagecomposer/src/job/distributionlistexpandjob.h @@ -54,7 +54,7 @@ private Q_SLOTS: void slotExpansionDone(KJob *); private: - QString mListName; + const QString mListName; QStringList mEmailAddresses; bool mIsEmpty = false; }; diff --git a/messagecomposer/src/recipient/kwindowpositioner.h b/messagecomposer/src/recipient/kwindowpositioner.h index 200ae1e5..01bd0bb9 100644 --- a/messagecomposer/src/recipient/kwindowpositioner.h +++ b/messagecomposer/src/recipient/kwindowpositioner.h @@ -24,8 +24,8 @@ public: void reposition(); private: - QWidget *mMaster = nullptr; - QWidget *mSlave = nullptr; + QWidget *const mMaster; + QWidget *const mSlave; Mode mMode = Bottom; }; diff --git a/messagecomposer/src/recipient/recipientseditorsidewidget.h b/messagecomposer/src/recipient/recipientseditorsidewidget.h index 3b1a719c..a596528d 100644 --- a/messagecomposer/src/recipient/recipientseditorsidewidget.h +++ b/messagecomposer/src/recipient/recipientseditorsidewidget.h @@ -42,7 +42,7 @@ Q_SIGNALS: void saveDistributionList(); private: - RecipientsEditor *mEditor = nullptr; + RecipientsEditor *const mEditor; QLabel *mTotalLabel = nullptr; QPushButton *mDistributionListButton = nullptr; QPushButton *mSelectButton = nullptr; diff --git a/messagecomposer/src/snippet/convertsnippetvariablemenu.h b/messagecomposer/src/snippet/convertsnippetvariablemenu.h index 543dff40..178ac30e 100644 --- a/messagecomposer/src/snippet/convertsnippetvariablemenu.h +++ b/messagecomposer/src/snippet/convertsnippetvariablemenu.h @@ -28,7 +28,7 @@ Q_SIGNALS: void insertVariable(MessageComposer::ConvertSnippetVariablesUtil::VariableType type); private: void initializeMenu(bool onlyMenuForCustomizeAttachmentFileName); - QWidget *mParentWidget = nullptr; + QWidget *const mParentWidget; QMenu *mMenu = nullptr; }; } -- GitLab