From 1fc6331afa3e07e700c28c51c41f626f94ced6fc Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Wed, 1 Jul 2020 08:12:30 +0200 Subject: [PATCH] Minor optimization --- src/job/fillcomposerjob.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/job/fillcomposerjob.cpp b/src/job/fillcomposerjob.cpp index e626318cf..a39825f9f 100644 --- a/src/job/fillcomposerjob.cpp +++ b/src/job/fillcomposerjob.cpp @@ -101,17 +101,18 @@ void FillComposerJob::slotOpenComposer() msgPart = new KMime::Content; msgPart->contentTransferEncoding()->fromUnicodeString(QLatin1String(mSettings.mAttachCte), "utf-8"); msgPart->setBody(mSettings.mAttachData); //TODO: check if was setBodyEncoded - msgPart->contentType()->setMimeType(mSettings.mAttachType + '/' + mSettings.mAttachSubType); - msgPart->contentType()->setParameter(QLatin1String(mSettings.mAttachParamAttr), mSettings.mAttachParamValue); //TODO: Check if the content disposition parameter needs to be set! + auto ct = msgPart->contentType(); //Create + ct->setMimeType(mSettings.mAttachType + '/' + mSettings.mAttachSubType); + ct->setParameter(QLatin1String(mSettings.mAttachParamAttr), mSettings.mAttachParamValue); //TODO: Check if the content disposition parameter needs to be set! if (!MessageViewer::MessageViewerSettings::self()->exchangeCompatibleInvitations()) { msgPart->contentDisposition()->fromUnicodeString(QLatin1String(mSettings.mAttachContDisp), "utf-8"); } if (!mSettings.mAttachCharset.isEmpty()) { // qCDebug(KMAIL_LOG) << "Set attachCharset to" << attachCharset; - msgPart->contentType()->setCharset(mSettings.mAttachCharset); + ct->setCharset(mSettings.mAttachCharset); } - msgPart->contentType()->setName(mSettings.mAttachName, "utf-8"); + ct->setName(mSettings.mAttachName, "utf-8"); msgPart->assemble(); // Don't show the composer window if the automatic sending is checked iCalAutoSend = MessageViewer::MessageViewerSettings::self()->automaticSending();