Git commit 1f8f804d3bbc360fd5671a89214bccc61c88b87f by Montel Laurent. Committed on 01/12/2014 at 12:35. Pushed by mlaurent into branch 'KDE/4.14'. Fix suggest automatic display M +1 -0 messagecore/attachment/attachmentupdatejob.cpp M +29 -0 messagecore/tests/attachmentupdatejobtest.cpp M +1 -0 messagecore/tests/attachmentupdatejobtest.h http://commits.kde.org/kdepim/1f8f804d3bbc360fd5671a89214bccc61c88b87f diff --git a/messagecore/attachment/attachmentupdatejob.cpp b/messagecore/a= ttachment/attachmentupdatejob.cpp index 4ee6747..d1cb75f 100644 --- a/messagecore/attachment/attachmentupdatejob.cpp +++ b/messagecore/attachment/attachmentupdatejob.cpp @@ -77,6 +77,7 @@ void AttachmentUpdateJob::Private::loadJobResult(KJob *jo= b) mUpdatedPart->setEncrypted(q->originalPart()->isEncrypted()); mUpdatedPart->setEncoding(q->originalPart()->encoding()); mUpdatedPart->setMimeType(q->originalPart()->mimeType()); + mUpdatedPart->setInline(q->originalPart()->isInline()); q->emitResult(); // Success. } = diff --git a/messagecore/tests/attachmentupdatejobtest.cpp b/messagecore/te= sts/attachmentupdatejobtest.cpp index 340c888..e986d18 100644 --- a/messagecore/tests/attachmentupdatejobtest.cpp +++ b/messagecore/tests/attachmentupdatejobtest.cpp @@ -198,4 +198,33 @@ void AttachmentUpdateJobTest::shouldNotUpdateWhenUrlIs= Empty() QVERIFY(!job->updatedPart()); } = +void AttachmentUpdateJobTest::shouldHaveSameInlineStatus() +{ + const KUrl url =3D KUrl::fromPath( PATH_ATTACHMENTS + QString::fromLat= in1( "file.txt" ) ); + + // Some data. + QByteArray data( "This is short enough that compressing it is not effi= cient." ); + const QString name =3D QString::fromLatin1( "name.txt" ); + const QString description =3D QString::fromLatin1( "description" ); + + // Create the original part. + MessageCore::AttachmentPart::Ptr origPart =3D MessageCore::AttachmentP= art::Ptr( new MessageCore::AttachmentPart ); + origPart->setName( name ); + origPart->setDescription( description ); + origPart->setMimeType( "text/pdf" ); + origPart->setEncoding( KMime::Headers::CE8Bit ); + origPart->setData( data ); + origPart->setUrl(url); + origPart->setSigned(true); + origPart->setEncrypted(true); + origPart->setInline(true); + + + MessageCore::AttachmentUpdateJob *job =3D new MessageCore::AttachmentU= pdateJob(origPart, this); + + VERIFYEXEC( job ); + QCOMPARE(origPart->isInline(), job->updatedPart()->isInline()); + +} + QTEST_KDEMAIN(AttachmentUpdateJobTest, NoGUI) diff --git a/messagecore/tests/attachmentupdatejobtest.h b/messagecore/test= s/attachmentupdatejobtest.h index 78bd5b3..8361255 100644 --- a/messagecore/tests/attachmentupdatejobtest.h +++ b/messagecore/tests/attachmentupdatejobtest.h @@ -35,6 +35,7 @@ private Q_SLOTS: void shouldHaveSameEncodingAfterUpdate(); void shouldHaveSameMimetypeAfterUpdate(); void shouldNotUpdateWhenUrlIsEmpty(); + void shouldHaveSameInlineStatus(); }; = #endif // ATTACHMENTUPDATEJOBTEST_H