Commit e5476f59 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Modernize code

parent 30c46ea9
Pipeline #33877 passed with stage
in 52 minutes and 37 seconds
......@@ -55,7 +55,7 @@ private:
KContacts::Picture mPhoto;
QPixmap mGravatarPixmap;
QImage mImageFromUrl;
QString mEmailAddress;
const QString mEmailAddress;
bool mFinished = false;
QPointer<Akonadi::ContactSearchJob> mSearchJob;
};
......
......@@ -29,7 +29,7 @@ public:
QStringList mExtraDisplay;
QString mAbsolutePath;
QString mMainFilename;
GrantleeHeaderFormatter *mGrantleeFormatter = nullptr;
GrantleeHeaderFormatter *const mGrantleeFormatter;
};
GrantleeHeaderTestStyle::GrantleeHeaderTestStyle()
......
......@@ -42,7 +42,7 @@ protected:
void addHelpTextAction(QAction *act, const QString &text);
void addActionToMenu(KActionMenu *menu, QActionGroup *actionGroup);
QList<KToggleAction *> mAction;
HeaderStylePlugin *mHeaderStylePlugin = nullptr;
HeaderStylePlugin *const mHeaderStylePlugin;
};
}
#endif // HEADERSTYLEINTERFACE_H
......@@ -27,7 +27,7 @@ public:
{
}
QString formatAllMessageHeaders(KMime::Message *message) const;
Q_REQUIRED_RESULT QString formatAllMessageHeaders(KMime::Message *message) const;
MessageViewer::HeaderStyleUtil mHeaderStyleUtil;
};
......
......@@ -40,7 +40,7 @@ private:
void insertBodyStyle();
private:
MailWebEngineView *mHtmlView = nullptr;
MailWebEngineView *const mHtmlView;
QString mExtraHead;
QString mStyleBody;
enum State {
......
......@@ -31,7 +31,7 @@ private:
void slotModifyItemDone(KJob *job);
void resetDisplayFormat();
void modifyDisplayFormat();
Akonadi::Session *mSession = nullptr;
Akonadi::Session *const mSession;
Akonadi::Item mMessageItem;
Viewer::DisplayFormatMessage mMessageFormat = Viewer::UseGlobalSetting;
bool mRemoteContent = false;
......
......@@ -61,17 +61,17 @@ private:
void editorExited();
void inotifyEvent();
void checkEditDone();
QUrl mUrl;
QString mMimeType;
const QUrl mUrl;
const QString mMimeType;
QTimer mTimer;
QElapsedTimer mEditTime;
KProcess *mEditor = nullptr;
QWidget *mParentWidget = nullptr;
QWidget *const mParentWidget;
int mInotifyFd = -1;
int mInotifyWatch = -1;
OpenWithOption mOpenWithOption;
const OpenWithOption mOpenWithOption;
bool mHaveInotify = false;
bool mFileOpen = false;
bool mEditorRunning = false;
......
......@@ -40,7 +40,7 @@ public:
Q_REQUIRED_RESULT bool showExpandQuotesMark() const override;
Q_REQUIRED_RESULT bool isPrinting() const override;
private:
ViewerPrivate *mViewer = nullptr;
ViewerPrivate *const mViewer;
};
}
......
......@@ -12,7 +12,6 @@ using namespace MimeTreeParser;
CryptoBodyPartMemento::CryptoBodyPartMemento()
: QObject(nullptr)
, Interface::BodyPartMemento()
, m_running(false)
{
}
......
......@@ -53,7 +53,7 @@ protected:
void setRunning(bool running);
private:
bool m_running;
bool m_running = false;
QString m_auditLog;
GpgME::Error m_auditLogError;
};
......
......@@ -40,7 +40,6 @@ ObjectTreeParser::ObjectTreeParser(const ObjectTreeParser *topLevelParser)
: mSource(topLevelParser->mSource)
, mNodeHelper(topLevelParser->mNodeHelper)
, mTopLevelContent(topLevelParser->mTopLevelContent)
, mHasPendingAsyncJobs(false)
, mAllowAsync(topLevelParser->mAllowAsync)
{
init();
......@@ -50,7 +49,6 @@ ObjectTreeParser::ObjectTreeParser(Interface::ObjectTreeSource *source, MimeTree
: mSource(source)
, mNodeHelper(nodeHelper)
, mTopLevelContent(nullptr)
, mHasPendingAsyncJobs(false)
, mAllowAsync(false)
{
init();
......
......@@ -313,7 +313,7 @@ private:
QByteArray mHtmlContentCharset;
QString mPlainTextContent;
QString mHtmlContent;
KMime::Content *mTopLevelContent;
KMime::Content *mTopLevelContent = nullptr;
MessagePartPtr mParsedPart;
/// Show only one mime part means that the user has selected some node in the message structure
......@@ -328,7 +328,7 @@ private:
/// the children can be completely displayed again.
bool mShowOnlyOneMimePart;
bool mHasPendingAsyncJobs;
bool mHasPendingAsyncJobs = false;
bool mAllowAsync;
// DataUrl Icons cache
QString mCollapseIcon;
......
......@@ -24,8 +24,8 @@ using namespace TemplateParser;
CustomTemplates::CustomTemplates(const QList<KActionCollection *> &actionCollection, QWidget *parent)
: QWidget(parent)
, mUi(new Ui_CustomTemplatesBase)
{
mUi = new Ui_CustomTemplatesBase;
mUi->setupUi(this);
mUi->mAdd->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
......@@ -108,7 +108,6 @@ CustomTemplates::~CustomTemplates()
disconnect(mUi->mToEdit, &TemplateParser::TemplateParserEmailAddressRequesterInterfaceWidget::textChanged, this, &CustomTemplates::slotTextChanged);
disconnect(mUi->mCCEdit, &TemplateParser::TemplateParserEmailAddressRequesterInterfaceWidget::textChanged, this, &CustomTemplates::slotTextChanged);
delete mUi;
mUi = nullptr;
}
void CustomTemplates::slotNameChanged(const QString &text)
......
......@@ -75,7 +75,7 @@ private:
/// templates, which changes the UI without user action
bool mBlockChangeSignal = false;
Ui_CustomTemplatesBase *mUi = nullptr;
Ui_CustomTemplatesBase *const mUi;
};
class CustomTemplateItem : public QTreeWidgetItem
......
......@@ -29,8 +29,8 @@ InvokeWrapper<Arg, R, C> invoke(R *receiver, void (C::*memberFun)(Arg))
TemplateExtractTextFromMail::TemplateExtractTextFromMail(QObject *parent)
: QObject(parent)
, mPage(new TemplateWebEnginePage(this))
{
mPage = new TemplateWebEnginePage(this);
connect(mPage, &TemplateWebEnginePage::loadFinished, this, &TemplateExtractTextFromMail::slotLoadFinished);
}
......
......@@ -34,7 +34,7 @@ private:
void setPlainText(const QString &plainText);
QString mExtractedPlainText;
TemplateWebEnginePage *mPage = nullptr;
TemplateWebEnginePage *const mPage;
};
}
#endif // TEMPLATEEXTRACTTEXTFROMMAIL_H
......@@ -15,7 +15,6 @@ using namespace TemplateParser;
TemplateParserEmailAddressRequesterInterfaceWidget::TemplateParserEmailAddressRequesterInterfaceWidget(QWidget *parent)
: QWidget(parent)
, mTemplateParserEmailBase(nullptr)
{
QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
......
......@@ -9,8 +9,8 @@ using namespace TemplateParser;
TemplatesInsertCommandAction::TemplatesInsertCommandAction(QObject *parent)
: QWidgetAction(parent)
, mMenuCommand(new TemplatesCommandMenu(this))
{
mMenuCommand = new TemplatesCommandMenu(this);
mMenuCommand->fillMenu();
mMenuCommand->fillSubMenus();
mMenuCommand->setObjectName(QStringLiteral("templatescommandmenu"));
......
......@@ -30,7 +30,7 @@ Q_SIGNALS:
void insertCommand(const QString &cmd, int adjustCursor);
private:
TemplatesCommandMenu *mMenuCommand = nullptr;
TemplatesCommandMenu *const mMenuCommand;
};
}
#endif // TEMPLATESINSERTCOMMANDACTION_H
......@@ -20,7 +20,6 @@ class WebEngineViewer::CheckPhishingUrlJobPrivate
{
public:
CheckPhishingUrlJobPrivate()
: mNetworkAccessManager(nullptr)
{
}
......
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