[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdepim/KDE/4.14] messagecore: Fix suggest automatic display
From: Montel Laurent <montel () kde ! org>
Date: 2014-12-01 12:35:45
Message-ID: E1XvQCf-0003ye-7g () scm ! kde ! org
[Download RAW message or body]
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/attachment/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 *job)
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/tests/attachmentupdatejobtest.cpp index 340c888..e986d18 100644
--- a/messagecore/tests/attachmentupdatejobtest.cpp
+++ b/messagecore/tests/attachmentupdatejobtest.cpp
@@ -198,4 +198,33 @@ void AttachmentUpdateJobTest::shouldNotUpdateWhenUrlIsEmpty()
QVERIFY(!job->updatedPart());
}
+void AttachmentUpdateJobTest::shouldHaveSameInlineStatus()
+{
+ const KUrl url = KUrl::fromPath( PATH_ATTACHMENTS + QString::fromLatin1( \
"file.txt" ) ); +
+ // Some data.
+ QByteArray data( "This is short enough that compressing it is not efficient." );
+ const QString name = QString::fromLatin1( "name.txt" );
+ const QString description = QString::fromLatin1( "description" );
+
+ // Create the original part.
+ MessageCore::AttachmentPart::Ptr origPart = MessageCore::AttachmentPart::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 = new \
MessageCore::AttachmentUpdateJob(origPart, this); +
+ VERIFYEXEC( job );
+ QCOMPARE(origPart->isInline(), job->updatedPart()->isInline());
+
+}
+
QTEST_KDEMAIN(AttachmentUpdateJobTest, NoGUI)
diff --git a/messagecore/tests/attachmentupdatejobtest.h \
b/messagecore/tests/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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic