diff options
-rw-r--r-- | tests/teststore.cpp | 15 | ||||
-rw-r--r-- | views/conversation/main.qml | 15 |
2 files changed, 29 insertions, 1 deletions
diff --git a/tests/teststore.cpp b/tests/teststore.cpp index 9d56dd33..84e2da20 100644 --- a/tests/teststore.cpp +++ b/tests/teststore.cpp | |||
@@ -64,6 +64,19 @@ static void createMail(const QVariantMap &object, const QByteArray &folder = {}) | |||
64 | auto ccAddresses = toStringList(object["cc"].toList()); | 64 | auto ccAddresses = toStringList(object["cc"].toList()); |
65 | auto bccAddresses = toStringList(object["bcc"].toList()); | 65 | auto bccAddresses = toStringList(object["bcc"].toList()); |
66 | 66 | ||
67 | QList<Attachment> attachments = {}; | ||
68 | if (object.contains("attachments")) { | ||
69 | auto attachmentSpecs = object["attachments"].toList(); | ||
70 | for (int i = 0; i < attachmentSpecs.size(); ++i) { | ||
71 | auto const &spec = attachmentSpecs.at(i).toMap(); | ||
72 | attachments << Attachment{spec["name"].toString(), | ||
73 | spec["name"].toString(), | ||
74 | spec["mimeType"].toByteArray(), | ||
75 | false, | ||
76 | spec["data"].toByteArray()}; | ||
77 | } | ||
78 | } | ||
79 | |||
67 | KMime::Types::Mailbox mb; | 80 | KMime::Types::Mailbox mb; |
68 | mb.fromUnicodeString("identity@example.org"); | 81 | mb.fromUnicodeString("identity@example.org"); |
69 | auto msg = MailTemplates::createMessage({}, | 82 | auto msg = MailTemplates::createMessage({}, |
@@ -74,7 +87,7 @@ static void createMail(const QVariantMap &object, const QByteArray &folder = {}) | |||
74 | object["subject"].toString(), | 87 | object["subject"].toString(), |
75 | object["body"].toString(), | 88 | object["body"].toString(), |
76 | object["bodyIsHtml"].toBool(), | 89 | object["bodyIsHtml"].toBool(), |
77 | {}, | 90 | attachments, |
78 | {}, | 91 | {}, |
79 | {}); | 92 | {}); |
80 | if (object.contains("messageId")) { | 93 | if (object.contains("messageId")) { |
diff --git a/views/conversation/main.qml b/views/conversation/main.qml index 64f7f273..4832d500 100644 --- a/views/conversation/main.qml +++ b/views/conversation/main.qml | |||
@@ -127,6 +127,21 @@ ApplicationWindow { | |||
127 | to: ["to@example.org"], | 127 | to: ["to@example.org"], |
128 | unread: true | 128 | unread: true |
129 | }, | 129 | }, |
130 | { | ||
131 | resource: "resource1", | ||
132 | date: "2017-07-20T17:47:29", | ||
133 | subject: "WithAttachment", | ||
134 | body: "Hi Mélanie,\n\nI'm sorry to start this on such late notice, but we'd like to get Foo and boo to woo next week, because the following weeks are unfortunately not possible for us.\n", | ||
135 | to: ["to@example.org"], | ||
136 | unread: true, | ||
137 | attachments: [ | ||
138 | { | ||
139 | name: "myImage.png", | ||
140 | mimeType: "image/png", | ||
141 | data: "no real data", | ||
142 | } | ||
143 | ], | ||
144 | } | ||
130 | ] | 145 | ] |
131 | }], | 146 | }], |
132 | } | 147 | } |