Summary: | If PGP/MIME encrypted messages are BCC'ed then except for one message all messages are empty | ||
---|---|---|---|
Product: | [Unmaintained] kmail | Reporter: | Ingo Klöcker <kloecker> |
Component: | encryption | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | david.guembel |
Priority: | NOR | ||
Version: | 1.7 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Ingo Klöcker
2004-10-30 22:06:23 UTC
This problem is also present in KDE 3.3 and KDE 3.3.1. CVS commit by kloecker: Fix PGP/MIME encrypting messages which are BCC'ed. The problem was that KMMessagePart contains a QByteArray which is explicitely shared. Therefore simply copying a KMMessagePart with the copy c'tor for getting a temporary copy isn't possible. Implementing and using a duplicate method fixes the problem. BUG: 92412 M +9 -0 kmmsgpart.cpp 1.113 M +4 -0 kmmsgpart.h 1.42 M +2 -1 messagecomposer.cpp 1.36 --- kdepim/kmail/kmmsgpart.h #1.41:1.42 @@ -23,4 +23,8 @@ public: void clear(); + /** Obtains an independant copy (i.e. without explicitely shared data) of the + data contained in msgPart. Returns a reference to this message part. */ + KMMessagePart & duplicate( const KMMessagePart & msgPart ); + /** Get or set the message body */ QCString body(void) const; --- kdepim/kmail/kmmsgpart.cpp #1.112:1.113 @@ -81,4 +81,13 @@ void KMMessagePart::clear() //----------------------------------------------------------------------------- +KMMessagePart & KMMessagePart::duplicate( const KMMessagePart & msgPart ) +{ + // copy the data of msgPart + *this = msgPart; + // detach the explicitely shared QByteArray + mBody.detach(); +} + +//----------------------------------------------------------------------------- int KMMessagePart::decodedSize(void) const { --- kdepim/kmail/messagecomposer.cpp #1.35:1.36 @@ -960,5 +960,6 @@ public: void execute() { - KMMessagePart tmpNewBodyPart = *mNewBodyPart; + KMMessagePart tmpNewBodyPart; + tmpNewBodyPart.duplicate( *mNewBodyPart ); // TODO: Async call |