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

Clean up code

parent e3784b10
......@@ -182,18 +182,13 @@ ViewerPrivate::ViewerPrivate(Viewer *aParent, QWidget *mainWindow, KActionCollec
: QObject(aParent)
, mNodeHelper(new MimeTreeParser::NodeHelper)
, mOldGlobalOverrideEncoding(QStringLiteral("---"))
, mMsgDisplay(true)
, mCSSHelper(nullptr)
, mMainWindow(mainWindow)
, mActionCollection(actionCollection)
, mCanStartDrag(false)
, mRecursionCountForDisplayMessage(0)
, q(aParent)
, mSession(new Akonadi::Session("MessageViewer-"
+ QByteArray::number(reinterpret_cast<quintptr>(this)), this))
, mPreviouslyViewedItem(-1)
{
mMimePartTree = nullptr;
if (!mainWindow) {
mMainWindow = aParent;
}
......@@ -214,15 +209,10 @@ ViewerPrivate::ViewerPrivate(Viewer *aParent, QWidget *mainWindow, KActionCollec
mShareServiceManager = new PimCommon::ShareServiceUrlManager(this);
mDisplayFormatMessageOverwrite = MessageViewer::Viewer::UseGlobalSetting;
mHtmlLoadExtOverride = false;
mHtmlLoadExternalDefaultSetting = false;
mHtmlMailGlobalSetting = false;
mUpdateReaderWinTimer.setObjectName(QStringLiteral("mUpdateReaderWinTimer"));
mResizeTimer.setObjectName(QStringLiteral("mResizeTimer"));
mPrinting = false;
createWidgets();
createActions();
......@@ -530,7 +520,7 @@ void ViewerPrivate::slotOpenWithDialogCurrentContent()
void ViewerPrivate::slotOpenWithDialog()
{
auto contents = selectedContents();
const auto contents = selectedContents();
if (contents.count() == 1) {
attachmentOpenWith(contents.first());
}
......@@ -803,10 +793,10 @@ KMime::Message::Ptr ViewerPrivate::message() const
bool ViewerPrivate::decryptMessage() const
{
if (!MessageViewer::MessageViewerSettings::self()->alwaysDecrypt()) {
return mDecrytMessageOverwrite;
} else {
if (MessageViewer::MessageViewerSettings::self()->alwaysDecrypt()) {
return true;
} else {
return mDecrytMessageOverwrite;
}
}
......@@ -2003,7 +1993,7 @@ const QTextCodec *ViewerPrivate::codecForName(const QByteArray &_str)
if (_str.isEmpty()) {
return nullptr;
}
QByteArray codec = _str.toLower();
const QByteArray codec = _str.toLower();
return KCharsets::charsets()->codecForName(QLatin1String(codec));
}
......
......@@ -611,9 +611,9 @@ private:
void applyZoomValue(qreal factor, bool saveConfig = true);
void slotZoomChanged(qreal zoom);
MimeTreeParser::NodeHelper *mNodeHelper = nullptr;
bool mHtmlMailGlobalSetting;
bool mHtmlLoadExternalDefaultSetting;
bool mHtmlLoadExtOverride;
bool mHtmlMailGlobalSetting = false;
bool mHtmlLoadExternalDefaultSetting = false;
bool mHtmlLoadExtOverride = false;
public:
KMime::Message::Ptr mMessage; //the current message, if it was set manually
Akonadi::Item mMessageItem; //the message item from Akonadi
......@@ -635,11 +635,11 @@ public:
/// This is true if the viewer currently is displaying a message. Can be false, for example when
/// the splash/busy page is displayed.
bool mMsgDisplay;
bool mMsgDisplay = true;
CSSHelper *mCSSHelper = nullptr;
bool mUseFixedFont;
bool mPrinting;
bool mPrinting = false;
QWidget *mMainWindow = nullptr;
KActionCollection *mActionCollection = nullptr;
QAction *mCopyAction = nullptr;
......@@ -667,7 +667,7 @@ public:
QUrl mClickedUrl;
QUrl mImageUrl;
QPoint mLastClickPosition;
bool mCanStartDrag;
bool mCanStartDrag = false;
HtmlWriter *mHtmlWriter = nullptr;
/** Used only to be able to connect and disconnect finished() signal
in printMsg() and slotPrintMsg() since mHtmlWriter points only to abstract non-QObject class. */
......@@ -678,7 +678,7 @@ public:
bool mShowSignatureDetails = false;
bool mShowEncryptionDetails = false;
bool mForceEmoticons = true;
int mRecursionCountForDisplayMessage;
int mRecursionCountForDisplayMessage = 0;
KMime::Content *mCurrentContent = nullptr;
KMime::Content *mMessagePartNode = nullptr;
QString mMessagePath;
......
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