Commit 8616ee44 authored by Milian Wolff's avatar Milian Wolff Committed by Milian Wolff
Browse files

Reuse the same data when inReplyTo and References are equal

This is only sharing the data within a single mail. It could
be optimized even further by reusing the same instance for every
thread. But I think that's not easy without implementing threading
on the server side.

This decreases peak memory consumption by ~100MB on my mails, when
opening the LKML folder.

Depends on new KMime API (cf.

Reviewed By: vkrause
Differential Revision:
parent e7c557a1
......@@ -79,7 +79,7 @@ set(KMBOX_LIB_VERSION "5.6.40")
set(KMIME_LIB_VERSION "5.6.40")
set(KMIME_LIB_VERSION "5.6.42")
......@@ -191,12 +191,18 @@ bool SerializerPluginMail::deserialize(Item &item, const QByteArray &label, QIOD
stream >> str;
msg->subject()->fromUnicodeString(str, QByteArrayLiteral("UTF-8"));
stream >> str;
msg->inReplyTo()->fromUnicodeString(str, QByteArrayLiteral("UTF-8"));
QString inReplyTo;
stream >> inReplyTo;
msg->inReplyTo()->fromUnicodeString(inReplyTo, QByteArrayLiteral("UTF-8"));
stream >> str;
msg->messageID()->fromUnicodeString(str, QByteArrayLiteral("UTF-8"));
stream >> str;
msg->references()->fromUnicodeString(str, QByteArrayLiteral("UTF-8"));
if (str == inReplyTo) {
} else {
msg->references()->fromUnicodeString(str, QByteArrayLiteral("UTF-8"));
parseAddrList(stream, msg->from(), version, m_stringPool);
parseAddrList(stream, msg->sender(), version, m_stringPool);
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