From 148a5814c3a317e2fb23c7c8cc3239cf1c1fb905 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Kundr=C3=A1t?= Date: Sun, 10 Sep 2017 16:27:51 +0200 Subject: [PATCH] refactoring: nullptr and formatting Change-Id: Ifad572f2296d62299610132b38f5548872346ac1 --- src/Gui/AttachmentView.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Gui/AttachmentView.cpp b/src/Gui/AttachmentView.cpp index 4b7e0077..10051823 100644 --- a/src/Gui/AttachmentView.cpp +++ b/src/Gui/AttachmentView.cpp @@ -54,10 +54,17 @@ namespace Gui { AttachmentView::AttachmentView(QWidget *parent, Imap::Network::MsgPartNetAccessManager *manager, - const QModelIndex &partIndex, MessageView *messageView, QWidget *contentWidget): - QFrame(parent), m_partIndex(partIndex), m_messageView(messageView), m_downloadAttachment(0), - m_openAttachment(0), m_showHideAttachment(0), m_showSource(0), m_netAccess(manager), m_tmpFile(0), - m_contentWidget(contentWidget) + const QModelIndex &partIndex, MessageView *messageView, QWidget *contentWidget) + : QFrame(parent) + , m_partIndex(partIndex) + , m_messageView(messageView) + , m_downloadAttachment(nullptr) + , m_openAttachment(nullptr) + , m_showHideAttachment(nullptr) + , m_showSource(nullptr) + , m_netAccess(manager) + , m_tmpFile(nullptr) + , m_contentWidget(contentWidget) { setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); setFrameStyle(QFrame::NoFrame); @@ -224,7 +231,7 @@ void AttachmentView::slotFileNameRequested(QString *fileName) if (!lastDir.exists()) lastDir = QDir(Common::writablePath(Common::LOCATION_DOWNLOAD)); QString fileLocation = lastDir.filePath(*fileName); - *fileName = QFileDialog::getSaveFileName(this, tr("Save Attachment"), fileLocation, QString(), 0, QFileDialog::HideNameFilterDetails); + *fileName = QFileDialog::getSaveFileName(this, tr("Save Attachment"), fileLocation, QString(), nullptr, QFileDialog::HideNameFilterDetails); if (!fileName->isEmpty()) lastDir = QFileInfo(*fileName).absoluteDir(); } @@ -237,7 +244,7 @@ void AttachmentView::enableDownloadAgain() void AttachmentView::onOpenFailed() { delete m_tmpFile; - m_tmpFile = 0; + m_tmpFile = nullptr; m_openAttachment->setEnabled(true); } @@ -253,7 +260,7 @@ void AttachmentView::openDownloadedAttachment() // This will delete the temporary file in ten seconds. It should give the application plenty of time to start and also prevent // leaving cruft behind. new Common::DeleteAfter(m_tmpFile, 10000); - m_tmpFile = 0; + m_tmpFile = nullptr; m_openAttachment->setEnabled(true); } -- 2.11.4.GIT