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

Use auto directly

parent 411d696d
Pipeline #45598 passed with stage
in 45 minutes and 49 seconds
......@@ -44,7 +44,7 @@ void AttachmentJobTest::testAttachment()
Composer composer;
composer.globalPart()->setFallbackCharsetEnabled(true);
AttachmentJob *ajob = new AttachmentJob(part, &composer);
auto ajob = new AttachmentJob(part, &composer);
QVERIFY(ajob->exec());
Content *result = ajob->content();
result->assemble();
......
......@@ -27,7 +27,7 @@ QTEST_MAIN(ComposerTest)
void ComposerTest::testAttachments()
{
auto *composer = new Composer;
auto composer = new Composer;
fillComposerData(composer);
AttachmentPart::Ptr attachment = AttachmentPart::Ptr(new AttachmentPart);
attachment->setData("abc");
......@@ -62,7 +62,7 @@ void ComposerTest::testAttachments()
void ComposerTest::testAutoSave()
{
auto *composer = new Composer;
auto composer = new Composer;
fillComposerData(composer);
AttachmentPart::Ptr attachment = AttachmentPart::Ptr(new AttachmentPart);
attachment->setData("abc");
......@@ -124,7 +124,7 @@ void ComposerTest::testBug271192()
{
const QString displayName = QStringLiteral("Интернет-компания example");
const QString mailbox = QStringLiteral("example@example.com");
auto *composer = new Composer;
auto composer = new Composer;
fillComposerData(composer);
composer->infoPart()->setTo(QStringList() << (displayName + QLatin1String(" <") + mailbox + QLatin1String(">")));
QVERIFY(composer->exec());
......
......@@ -72,7 +72,7 @@ void CryptoComposerTest::testOpenPGPMime()
QFETCH(bool, encrypt);
QFETCH(Headers::contentEncoding, cte);
auto *composer = new Composer;
auto composer = new Composer;
fillComposerData(composer, data);
fillComposerCryptoData(composer);
......@@ -108,7 +108,7 @@ void CryptoComposerTest::testEncryptSameAttachments_data()
void CryptoComposerTest::testEncryptSameAttachments()
{
QFETCH(int, format);
auto *composer = new Composer;
auto composer = new Composer;
QString data(QStringLiteral("All happy families are alike; each unhappy family is unhappy in its own way."));
fillComposerData(composer, data);
fillComposerCryptoData(composer);
......@@ -140,7 +140,7 @@ void CryptoComposerTest::testEncryptSameAttachments()
MimeTreeParser::SimpleObjectTreeSource testSource;
testSource.setDecryptMessage(true);
auto *nh = new MimeTreeParser::NodeHelper;
auto nh = new MimeTreeParser::NodeHelper;
MimeTreeParser::ObjectTreeParser otp(&testSource, nh);
otp.parseObjectTree(message.data());
......@@ -162,7 +162,7 @@ void CryptoComposerTest::testEditEncryptAttachments_data()
void CryptoComposerTest::testEditEncryptAttachments()
{
QFETCH(int, format);
auto *composer = new Composer;
auto composer = new Composer;
QString data(QStringLiteral("All happy families are alike; each unhappy family is unhappy in its own way."));
fillComposerData(composer, data);
fillComposerCryptoData(composer);
......@@ -218,7 +218,7 @@ void CryptoComposerTest::testEditEncryptAndLateAttachments_data()
void CryptoComposerTest::testEditEncryptAndLateAttachments()
{
QFETCH(int, format);
auto *composer = new Composer;
auto composer = new Composer;
QString data(QStringLiteral("All happy families are alike; each unhappy family is unhappy in its own way."));
fillComposerData(composer, data);
fillComposerCryptoData(composer);
......@@ -287,7 +287,7 @@ void CryptoComposerTest::testSignEncryptLateAttachments_data()
void CryptoComposerTest::testSignEncryptLateAttachments()
{
QFETCH(int, format);
auto *composer = new Composer;
auto composer = new Composer;
QString data(QStringLiteral("All happy families are alike; each unhappy family is unhappy in its own way."));
fillComposerData(composer, data);
fillComposerCryptoData(composer);
......@@ -335,7 +335,7 @@ void CryptoComposerTest::testBCCEncrypt_data()
void CryptoComposerTest::testBCCEncrypt()
{
QFETCH(int, format);
auto *composer = new Composer;
auto composer = new Composer;
QString data(QStringLiteral("All happy families are alike; each unhappy family is unhappy in its own way."));
fillComposerData(composer, data);
composer->infoPart()->setBcc(QStringList(QStringLiteral("bcc@bcc.org")));
......@@ -404,7 +404,7 @@ void CryptoComposerTest::testOpenPGPInline()
QFETCH(bool, encrypt);
QFETCH(Headers::contentEncoding, cte);
auto *composer = new Composer;
auto composer = new Composer;
fillComposerData(composer, data);
fillComposerCryptoData(composer);
......@@ -555,7 +555,7 @@ void CryptoComposerTest::runSMIMETest(bool sign, bool enc, bool opaque)
QFETCH(QString, data);
QFETCH(Headers::contentEncoding, cte);
auto *composer = new Composer;
auto composer = new Composer;
fillComposerData(composer, data);
composer->infoPart()->setFrom(QStringLiteral("test@example.com"));
......
......@@ -39,13 +39,13 @@ void ComposerTestUtil::verify(bool sign, bool encrypt, KMime::Content *content,
void ComposerTestUtil::verifySignature(KMime::Content *content, const QByteArray &signedContent, Kleo::CryptoMessageFormat f, KMime::Headers::contentEncoding encoding)
{
// store it in a KMime::Message, that's what OTP needs
auto *resultMessage = new KMime::Message;
auto resultMessage = new KMime::Message;
resultMessage->setContent(content->encodedContent());
resultMessage->parse();
// parse the result and make sure it is valid in various ways
MimeTreeParser::SimpleObjectTreeSource testSource;
auto *nh = new MimeTreeParser::NodeHelper;
auto nh = new MimeTreeParser::NodeHelper;
MimeTreeParser::ObjectTreeParser otp(&testSource, nh);
// ensure the signed part exists and is parseable
......@@ -115,7 +115,7 @@ void ComposerTestUtil::verifyEncryption(KMime::Content *content, const QByteArra
// parse the result and make sure it is valid in various ways
MimeTreeParser::SimpleObjectTreeSource testSource;
testSource.setDecryptMessage(true);
auto *nh = new MimeTreeParser::NodeHelper;
auto nh = new MimeTreeParser::NodeHelper;
MimeTreeParser::ObjectTreeParser otp(&testSource, nh);
if (f & Kleo::OpenPGPMIMEFormat) {
......@@ -168,7 +168,7 @@ void ComposerTestUtil::verifySignatureAndEncryption(KMime::Content *content, con
// parse the result and make sure it is valid in various ways
MimeTreeParser::SimpleObjectTreeSource testSource;
testSource.setDecryptMessage(true);
auto *nh = new MimeTreeParser::NodeHelper;
auto nh = new MimeTreeParser::NodeHelper;
MimeTreeParser::ObjectTreeParser otp(&testSource, nh);
if (f & Kleo::OpenPGPMIMEFormat) {
......
......@@ -115,7 +115,7 @@ void EncryptJobTest::testContentSubjobChained()
const QByteArray data(QStringLiteral("one flew over the cuckoo's nest").toUtf8());
KMime::Message skeletonMessage;
auto *content = new KMime::Content;
auto content = new KMime::Content;
content->contentType(true)->setMimeType("text/plain");
content->setBody(data);
......@@ -192,7 +192,7 @@ void EncryptJobTest::testProtectedHeaders()
const std::vector< GpgME::Key > &keys = Test::getKeys();
Composer composer;
auto *eJob = new EncryptJob(&composer);
auto eJob = new EncryptJob(&composer);
QVERIFY(eJob);
......
......@@ -39,15 +39,15 @@ void MainTextJobTest::initTestCase()
void MainTextJobTest::testPlainText()
{
auto *composer = new Composer;
auto composer = new Composer;
composer->globalPart()->setGuiEnabled(false);
QVector<QByteArray> charsets;
charsets << "us-ascii" << "utf-8";
composer->globalPart()->setCharsets(charsets);
auto *textPart = new TextPart;
auto textPart = new TextPart;
QString data = QStringLiteral("they said their nevers they slept their dream");
textPart->setWrappedPlainText(data);
auto *mjob = new MainTextJob(textPart, composer);
auto mjob = new MainTextJob(textPart, composer);
QVERIFY(mjob->exec());
Content *result = mjob->content();
result->assemble();
......@@ -63,28 +63,28 @@ void MainTextJobTest::testPlainText()
void MainTextJobTest::testWrappingErrors()
{
{
auto *composer = new Composer;
auto composer = new Composer;
composer->globalPart()->setGuiEnabled(false);
composer->globalPart()->setFallbackCharsetEnabled(true);
auto *textPart = new TextPart;
auto textPart = new TextPart;
QString data = QStringLiteral("they said their nevers they slept their dream");
textPart->setWordWrappingEnabled(false);
textPart->setWrappedPlainText(data);
auto *mjob = new MainTextJob(textPart, composer);
auto mjob = new MainTextJob(textPart, composer);
QVERIFY(!mjob->exec()); // error: not UseWrapping but given only wrapped text
QCOMPARE(mjob->error(), int(JobBase::BugError));
delete textPart;
delete composer;
}
{
auto *composer = new Composer;
auto composer = new Composer;
composer->globalPart()->setGuiEnabled(false);
composer->globalPart()->setFallbackCharsetEnabled(true);
auto *textPart = new TextPart;
auto textPart = new TextPart;
textPart->setWordWrappingEnabled(true);
QString data = QStringLiteral("they said their nevers they slept their dream");
textPart->setCleanPlainText(data);
auto *mjob = new MainTextJob(textPart, composer);
auto mjob = new MainTextJob(textPart, composer);
QVERIFY(!mjob->exec()); // error: UseWrapping but given only clean text
QCOMPARE(mjob->error(), int(JobBase::BugError));
delete textPart;
......@@ -94,14 +94,14 @@ void MainTextJobTest::testWrappingErrors()
void MainTextJobTest::testCustomCharset()
{
auto *composer = new Composer;
auto composer = new Composer;
composer->globalPart()->setGuiEnabled(false);
QByteArray charset("iso-8859-2");
composer->globalPart()->setCharsets(QVector<QByteArray>() << charset);
auto *textPart = new TextPart;
auto textPart = new TextPart;
QString data = QStringLiteral("şi el o să se-nchidă cu o frunză de pelin");
textPart->setWrappedPlainText(data);
auto *mjob = new MainTextJob(textPart, composer);
auto mjob = new MainTextJob(textPart, composer);
QVERIFY(mjob->exec());
Content *result = mjob->content();
result->assemble();
......@@ -119,13 +119,13 @@ void MainTextJobTest::testCustomCharset()
void MainTextJobTest::testNoCharset()
{
auto *composer = new Composer;
auto composer = new Composer;
QVERIFY(!composer->globalPart()->isFallbackCharsetEnabled());
composer->globalPart()->setGuiEnabled(false);
auto *textPart = new TextPart;
auto textPart = new TextPart;
QString data = QStringLiteral("do you still play the accordion?");
textPart->setWrappedPlainText(data);
auto *mjob = new MainTextJob(textPart, composer);
auto mjob = new MainTextJob(textPart, composer);
QSKIP("This tests has been failing for a long time, please someone fix it", SkipSingle);
QVERIFY(!mjob->exec()); // Error.
QCOMPARE(mjob->error(), int(JobBase::BugError));
......@@ -136,14 +136,14 @@ void MainTextJobTest::testNoCharset()
void MainTextJobTest::testBadCharset()
{
auto *composer = new Composer;
auto composer = new Composer;
composer->globalPart()->setGuiEnabled(false);
QByteArray charset("us-ascii"); // Cannot handle Romanian chars.
composer->globalPart()->setCharsets(QVector<QByteArray>() << charset);
auto *textPart = new TextPart;
auto textPart = new TextPart;
QString data = QStringLiteral("el a plâns peste ţară cu lacrima limbii noastre");
textPart->setWrappedPlainText(data);
auto *mjob = new MainTextJob(textPart, composer);
auto mjob = new MainTextJob(textPart, composer);
QSKIP("This tests has been failing for a long time, please someone fix it", SkipSingle);
QVERIFY(!mjob->exec()); // Error.
QCOMPARE(mjob->error(), int(JobBase::UserError));
......@@ -154,13 +154,13 @@ void MainTextJobTest::testBadCharset()
void MainTextJobTest::testFallbackCharset()
{
auto *composer = new Composer;
auto composer = new Composer;
composer->globalPart()->setGuiEnabled(false);
composer->globalPart()->setFallbackCharsetEnabled(true);
auto *textPart = new TextPart;
auto textPart = new TextPart;
QString data = QStringLiteral("and when he falleth...");
textPart->setWrappedPlainText(data);
auto *mjob = new MainTextJob(textPart, composer);
auto mjob = new MainTextJob(textPart, composer);
QVERIFY(mjob->exec());
Content *result = mjob->content();
result->assemble();
......@@ -181,14 +181,14 @@ void MainTextJobTest::testHtml()
editor.setTextOrHtml(originalHtml);
QVERIFY(editor.composerControler()->isFormattingUsed());
auto *composer = new Composer;
auto composer = new Composer;
composer->globalPart()->setGuiEnabled(false);
composer->globalPart()->setFallbackCharsetEnabled(true);
auto *textPart = new TextPart;
auto textPart = new TextPart;
textPart->setWordWrappingEnabled(false);
textPart->setCleanPlainText(editor.composerControler()->toCleanPlainText());
textPart->setCleanHtml(editor.toCleanHtml());
auto *mjob = new MainTextJob(textPart, composer);
auto mjob = new MainTextJob(textPart, composer);
QVERIFY(mjob->exec());
Content *result = mjob->content();
result->assemble();
......@@ -247,15 +247,15 @@ void MainTextJobTest::testHtmlWithImages()
QString name1 = images[0]->imageName;
QString name2 = images[1]->imageName;
auto *composer = new Composer;
auto composer = new Composer;
composer->globalPart()->setGuiEnabled(false);
composer->globalPart()->setFallbackCharsetEnabled(true);
auto *textPart = new TextPart;
auto textPart = new TextPart;
textPart->setWordWrappingEnabled(false);
textPart->setCleanPlainText(editor.composerControler()->toCleanPlainText());
textPart->setCleanHtml(editor.composerControler()->toCleanHtml());
textPart->setEmbeddedImages(editor.composerControler()->composerImages()->embeddedImages());
auto *mjob = new MainTextJob(textPart, composer);
auto mjob = new MainTextJob(textPart, composer);
QVERIFY(mjob->exec());
Content *result = mjob->content();
result->assemble();
......
......@@ -831,7 +831,7 @@ void MessageFactoryTest::testCreateMDN()
KMime::Message::Ptr MessageFactoryTest::createPlainTestMessage()
{
auto *composer = new Composer;
auto composer = new Composer;
composer->globalPart()->setFallbackCharsetEnabled(true);
composer->infoPart()->setFrom(QStringLiteral("me@me.me"));
composer->infoPart()->setTo(QStringList(QStringLiteral("you@you.you")));
......@@ -852,7 +852,7 @@ KMime::Message::Ptr MessageFactoryTest::createPlainTestMessage()
KMime::Message::Ptr MessageFactoryTest::createPlainTestMessageWithMultiEmails()
{
auto *composer = new Composer;
auto composer = new Composer;
composer->globalPart()->setFallbackCharsetEnabled(true);
composer->infoPart()->setFrom(QStringLiteral("me@me.me"));
composer->infoPart()->setTo(QStringList() << QStringLiteral("you@you.you") << QStringLiteral("you2@you.you"));
......
......@@ -23,7 +23,7 @@ QTEST_MAIN(MultipartJobTest)
void MultipartJobTest::testMultipartMixed()
{
Composer composer;
auto *mjob = new MultipartJob(&composer);
auto mjob = new MultipartJob(&composer);
mjob->setMultipartSubtype("mixed");
QByteArray data1("one");
......@@ -32,13 +32,13 @@ void MultipartJobTest::testMultipartMixed()
QByteArray type2("application/x-mors-ontologica");
{
auto *cjob = new SinglepartJob(mjob);
auto cjob = new SinglepartJob(mjob);
cjob->setData(data1);
cjob->contentType()->setMimeType(type1);
}
{
auto *cjob = new SinglepartJob(mjob);
auto cjob = new SinglepartJob(mjob);
cjob->setData(data2);
cjob->contentType()->setMimeType(type2);
}
......@@ -74,11 +74,11 @@ void MultipartJobTest::test8BitPropagation()
Composer composer;
composer.globalPart()->set8BitAllowed(true);
auto *mjob = new MultipartJob(&composer);
auto mjob = new MultipartJob(&composer);
mjob->setMultipartSubtype("mixed");
auto *mjob2 = new MultipartJob(mjob);
auto mjob2 = new MultipartJob(mjob);
mjob2->setMultipartSubtype("mixed");
auto *cjob = new SinglepartJob(mjob2);
auto cjob = new SinglepartJob(mjob2);
QByteArray data("time is so short and I'm sure there must be something more");
cjob->setData(data);
cjob->contentTransferEncoding()->setEncoding(Headers::CE8Bit);
......
......@@ -31,12 +31,12 @@ void SendLaterDialogTest::initTestCase()
void SendLaterDialogTest::shouldHaveDefaultValue()
{
MessageComposer::SendLaterDialog dlg(nullptr);
auto *timeCombo = dlg.findChild<KTimeComboBox *>(QStringLiteral("time_sendlater"));
auto timeCombo = dlg.findChild<KTimeComboBox *>(QStringLiteral("time_sendlater"));
QVERIFY(timeCombo);
auto *dateCombo = dlg.findChild<KDateComboBox *>(QStringLiteral("date_sendlater"));
auto dateCombo = dlg.findChild<KDateComboBox *>(QStringLiteral("date_sendlater"));
QVERIFY(dateCombo);
QVERIFY(dateCombo->date().isValid());
auto *okButton = dlg.findChild<QPushButton *>(QStringLiteral("okbutton"));
auto okButton = dlg.findChild<QPushButton *>(QStringLiteral("okbutton"));
QVERIFY(okButton);
QVERIFY(okButton->isEnabled());
dateCombo->lineEdit()->clear();
......
......@@ -88,8 +88,8 @@ void SignAndEncryptTest::testHeaders()
const std::vector< GpgME::Key > &keys = Test::getKeys();
Composer composer;
auto *sJob = new SignJob(&composer);
auto *eJob = new EncryptJob(&composer);
auto sJob = new SignJob(&composer);
auto eJob = new EncryptJob(&composer);
QVERIFY(sJob);
QVERIFY(eJob);
......
......@@ -21,8 +21,8 @@ QTEST_MAIN(SinglepartJobTest)
void SinglepartJobTest::testContent()
{
auto *composer = new Composer;
auto *cjob = new SinglepartJob(composer);
auto composer = new Composer;
auto cjob = new SinglepartJob(composer);
QByteArray data("birds came flying from the underground");
cjob->setData(data);
QVERIFY(cjob->exec());
......@@ -39,8 +39,8 @@ void SinglepartJobTest::testContent()
void SinglepartJobTest::testContentDisposition()
{
auto *composer = new Composer;
auto *cjob = new SinglepartJob(composer);
auto composer = new Composer;
auto cjob = new SinglepartJob(composer);
QByteArray data("birds came flying from the underground");
cjob->setData(data);
QString filename = QStringLiteral("test_ăîşţâ.txt");
......@@ -60,8 +60,8 @@ void SinglepartJobTest::testContentDisposition()
void SinglepartJobTest::testContentID()
{
auto *composer = new Composer;
auto *cjob = new SinglepartJob(composer);
auto composer = new Composer;
auto cjob = new SinglepartJob(composer);
QByteArray data("birds came flying from the underground");
QByteArray id("play@cold");
cjob->setData(data);
......@@ -80,8 +80,8 @@ void SinglepartJobTest::testContentID()
void SinglepartJobTest::testContentType()
{
auto *composer = new Composer;
auto *cjob = new SinglepartJob(composer);
auto composer = new Composer;
auto cjob = new SinglepartJob(composer);
QByteArray data("birds came flying from the underground");
cjob->setData(data);
QByteArray mimeType("text/plain");
......@@ -103,13 +103,13 @@ void SinglepartJobTest::testContentType()
void SinglepartJobTest::testContentTransferEncoding()
{
auto *composer = new Composer;
auto composer = new Composer;
QVERIFY(!composer->globalPart()->is8BitAllowed());
composer->globalPart()->setFallbackCharsetEnabled(true);
// 7bit if possible.
{
auto *cjob = new SinglepartJob(composer);
auto cjob = new SinglepartJob(composer);
QByteArray data("and the sun will set for you...");
cjob->setData(data);
QVERIFY(cjob->exec());
......@@ -124,7 +124,7 @@ void SinglepartJobTest::testContentTransferEncoding()
// quoted-printable if text doesn't fit in 7bit.
{
auto *cjob = new SinglepartJob(composer);
auto cjob = new SinglepartJob(composer);
QByteArray data("some long text to make qupr more compact than base64 [ăîşţâ]"); // utf-8
cjob->setData(data);
QVERIFY(cjob->exec());
......@@ -139,7 +139,7 @@ void SinglepartJobTest::testContentTransferEncoding()
// base64 if it's shorter than quoted-printable
{
auto *cjob = new SinglepartJob(composer);
auto cjob = new SinglepartJob(composer);
QByteArray data("[ăîşţâ]"); // utf-8
cjob->setData(data);
QVERIFY(cjob->exec());
......@@ -156,7 +156,7 @@ void SinglepartJobTest::testContentTransferEncoding()
{
composer->globalPart()->set8BitAllowed(true);
QByteArray data("[ăîşţâ]"); // utf-8
auto *cjob = new SinglepartJob(composer);
auto cjob = new SinglepartJob(composer);
cjob->setData(data);
QVERIFY(cjob->exec());
Content *result = cjob->content();
......
......@@ -31,7 +31,7 @@ void SkeletonMessageJobTest::testSubject_data()
void SkeletonMessageJobTest::testSubject()
{
// An InfoPart should belong to a Composer, even if we don't use the composer itself.
auto *composer = new Composer;
auto composer = new Composer;
InfoPart *infoPart = composer->infoPart();
GlobalPart *globalPart = composer->globalPart();
Q_ASSERT(infoPart);
......@@ -39,7 +39,7 @@ void SkeletonMessageJobTest::testSubject()
QFETCH(QString, subject);
//qDebug() << subject;
infoPart->setSubject(subject);
auto *sjob = new SkeletonMessageJob(infoPart, globalPart, composer);
auto sjob = new SkeletonMessageJob(infoPart, globalPart, composer);
QVERIFY(sjob->exec());
KMime::Message *message = sjob->message();
QVERIFY(message->subject(false));
......@@ -122,7 +122,7 @@ void SkeletonMessageJobTest::testAddresses_data()
void SkeletonMessageJobTest::testAddresses()
{
// An InfoPart should belong to a Composer, even if we don't use the composer itself.
auto *composer = new Composer;
auto composer = new Composer;
InfoPart *infoPart = composer->infoPart();
GlobalPart *globalPart = composer->globalPart();
Q_ASSERT(infoPart);
......@@ -137,7 +137,7 @@ void SkeletonMessageJobTest::testAddresses()
infoPart->setTo(to);
infoPart->setCc(cc);
infoPart->setBcc(bcc);
auto *sjob = new SkeletonMessageJob(infoPart, globalPart, composer);
auto sjob = new SkeletonMessageJob(infoPart, globalPart, composer);
QVERIFY(sjob->exec());
KMime::Message *message = sjob->message();
......@@ -191,12 +191,12 @@ void SkeletonMessageJobTest::testAddresses()
void SkeletonMessageJobTest::testMessageID()
{
auto *composer = new Composer();
auto composer = new Composer();
InfoPart *infoPart = composer->infoPart();
GlobalPart *globalPart = composer->globalPart();
Q_ASSERT(infoPart);
auto *sjob = new SkeletonMessageJob(infoPart, globalPart, composer);
auto sjob = new SkeletonMessageJob(infoPart, globalPart, composer);
QVERIFY(sjob->exec());
KMime::Message *message = sjob->message();
QVERIFY(message->messageID(false));
......
......@@ -169,7 +169,7 @@ void AttachmentControllerBase::Private::compressJobResult(KJob *job)
return;
}
auto *ajob = qobject_cast<AttachmentCompressJob *>(job);
auto ajob = qobject_cast<AttachmentCompressJob *>(job);
Q_ASSERT(ajob);
AttachmentPart::Ptr originalPart = ajob->originalPart();
AttachmentPart::Ptr compressedPart = ajob->compressedPart();
......@@ -203,7 +203,7 @@ void AttachmentControllerBase::Private::loadJobResult(KJob *job)
return;
}
auto *ajob = qobject_cast<AttachmentLoadJob *>(job);
auto ajob = qobject_cast<AttachmentLoadJob *>(job);
Q_ASSERT(ajob);
AttachmentPart::Ptr part = ajob->attachmentPart();
q->addAttachment(part);
......@@ -262,7 +262,7 @@ void AttachmentControllerBase::Private::selectedAttachmentProperties()
void AttachmentControllerBase::Private::reloadAttachment()
{
Q_ASSERT(selectedParts.count() == 1);
auto *ajob = new AttachmentUpdateJob(selectedParts.constFirst(), q);
auto ajob = new AttachmentUpdateJob(selectedParts.constFirst(), q);
connect(ajob, &AttachmentUpdateJob::result, q, [this](KJob *job) {
updateJobResult(job);
});
......@@ -275,7 +275,7 @@ void AttachmentControllerBase::Private::updateJobResult(KJob *job)
KMessageBox::sorry(wParent, job->errorString(), i18n("Failed to reload attachment"));
return;
}
auto *ajob = qobject_cast<AttachmentUpdateJob *>(job);
auto ajob = qobject_cast<AttachmentUpdateJob *>(job);
Q_ASSERT(ajob);
AttachmentPart::Ptr originalPart = ajob->originalPart();
AttachmentPart::Ptr updatedPart = ajob->updatedPart();
......@@ -315,7 +315,7 @@ void AttachmentControllerBase::Private::createOpenWithMenu(QMenu *topMenu, const
const KService::List offers = KFileItemActions::associatedApplications(QStringList() << contentTypeStr, QString());
if (!offers.isEmpty()) {
QMenu *menu = topMenu;
auto *actionGroup = new QActionGroup(menu);
auto actionGroup = new QActionGroup(menu);
connect(actionGroup, &QActionGroup::triggered, q, &AttachmentControllerBase::slotOpenWithAction);