Commit 2efdb89e authored by Milian Wolff's avatar Milian Wolff Committed by Milian Wolff

Add KMime::Ident::fromIdent

This allows us to initialize an identifier from another one. This
in turn shares the internal memory and can be used to decrease
KMail memory consumption in a few places.

Reviewed By: vkrause
Differential Revision:
parent d103a3ff
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.0)
set(PIM_VERSION "5.6.41") set(PIM_VERSION "5.6.42")
...@@ -996,6 +996,13 @@ QVector<QByteArray> Ident::identifiers() const ...@@ -996,6 +996,13 @@ QVector<QByteArray> Ident::identifiers() const
return rv; return rv;
} }
void Ident::fromIdent(const Ident* ident)
d_func()->encCS = ident->d_func()->encCS;
d_func()->msgIdList = ident->d_func()->msgIdList;
d_func()->cachedIdentifier = ident->d_func()->cachedIdentifier;
void Ident::appendIdentifier(const QByteArray &id) void Ident::appendIdentifier(const QByteArray &id)
{ {
Q_D(Ident); Q_D(Ident);
...@@ -514,6 +514,11 @@ public: ...@@ -514,6 +514,11 @@ public:
void clear() override; void clear() override;
bool isEmpty() const override; bool isEmpty() const override;
Initialize this identifier Copy the data from
void fromIdent(const Ident* ident);
/** /**
Returns the list of identifiers contained in this header. Returns the list of identifiers contained in this header.
Note: Note:
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