Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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

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. https://phabricator.kde.org/D7920).

Reviewed By: vkrause
Differential Revision: https://phabricator.kde.org/D7921
parent e7c557a1
......@@ -79,7 +79,7 @@ set(KMBOX_LIB_VERSION "5.6.40")
set(AKONADICALENDAR_LIB_VERSION "5.6.40")
set(KONTACTINTERFACE_LIB_VERSION "5.6.40")
set(AKONADIKALARM_LIB_VERSION "5.6.40")
set(KMIME_LIB_VERSION "5.6.40")
set(KMIME_LIB_VERSION "5.6.42")
set(XMLRPCCLIENT_LIB_VERSION "5.6.40")
set(KCONTACTS_LIB_VERSION "5.6.40")
set(AKONADIMIME_LIB_VERSION "5.6.40")
......
......@@ -191,12 +191,18 @@ bool SerializerPluginMail::deserialize(Item &item, const QByteArray &label, QIOD
msg->date()->setDateTime(dt);
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) {
msg->references()->fromIdent(msg->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