Commit 1fc6331a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor optimization

parent 046d2cb2
Pipeline #25537 passed with stage
in 59 minutes and 17 seconds
...@@ -101,17 +101,18 @@ void FillComposerJob::slotOpenComposer() ...@@ -101,17 +101,18 @@ void FillComposerJob::slotOpenComposer()
msgPart = new KMime::Content; msgPart = new KMime::Content;
msgPart->contentTransferEncoding()->fromUnicodeString(QLatin1String(mSettings.mAttachCte), "utf-8"); msgPart->contentTransferEncoding()->fromUnicodeString(QLatin1String(mSettings.mAttachCte), "utf-8");
msgPart->setBody(mSettings.mAttachData); //TODO: check if was setBodyEncoded msgPart->setBody(mSettings.mAttachData); //TODO: check if was setBodyEncoded
msgPart->contentType()->setMimeType(mSettings.mAttachType + '/' + mSettings.mAttachSubType); auto ct = msgPart->contentType(); //Create
msgPart->contentType()->setParameter(QLatin1String(mSettings.mAttachParamAttr), mSettings.mAttachParamValue); //TODO: Check if the content disposition parameter needs to be set! 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()) { if (!MessageViewer::MessageViewerSettings::self()->exchangeCompatibleInvitations()) {
msgPart->contentDisposition()->fromUnicodeString(QLatin1String(mSettings.mAttachContDisp), "utf-8"); msgPart->contentDisposition()->fromUnicodeString(QLatin1String(mSettings.mAttachContDisp), "utf-8");
} }
if (!mSettings.mAttachCharset.isEmpty()) { if (!mSettings.mAttachCharset.isEmpty()) {
// qCDebug(KMAIL_LOG) << "Set attachCharset to" << attachCharset; // 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(); msgPart->assemble();
// Don't show the composer window if the automatic sending is checked // Don't show the composer window if the automatic sending is checked
iCalAutoSend = MessageViewer::MessageViewerSettings::self()->automaticSending(); iCalAutoSend = MessageViewer::MessageViewerSettings::self()->automaticSending();
......
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