Bug#264332: KMail crash: simple patch for 3.2.3
tags 263895 + patch
thanks mate
Hi.
According to upstream's BTS, this crash was introduced in kmcommands.cpp
revision 1.99.2.6 (BARNCH) / 1.155 (HEAD) with the following change:
--- kdepim/kmail/kmcommands.cpp 2004/06/12 13:46:48 1.99.2.5
+++ kdepim/kmail/kmcommands.cpp 2004/06/28 14:57:58 1.99.2.6
@@ -552,7 +552,9 @@ KMShowMsgSrcCommand::KMShowMsgSrcCommand
void KMShowMsgSrcCommand::execute()
{
KMMessage *msg = retrievedMessage();
- QString str = QString::fromLatin1( msg->asString() );
+ QString str = QTextCodec::codecForName( msg->charset().isEmpty() ?
+ QCString( kmkernel->networkCodec()->mimeName() ) :
+ msg->charset() )->toUnicode( msg->asString() );
MailSourceViewer *viewer = new MailSourceViewer(); // deletes itself
upon close
viewer->setCaption( i18n("Message as Plain Text") );
The crash was then fixed three days later in 1.556 (HEAD):
--- kdepim/kmail/kmcommands.cpp 2004/06/25 08:06:13 1.155
+++ kdepim/kmail/kmcommands.cpp 2004/06/28 17:31:17 1.156
@@ -616,9 +616,7 @@ KMShowMsgSrcCommand::KMShowMsgSrcCommand
KMCommand::Result KMShowMsgSrcCommand::execute()
{
KMMessage *msg = retrievedMessage();
- QString str = QTextCodec::codecForName( msg->charset().isEmpty() ?
- QCString( kmkernel->networkCodec()->mimeName() ) :
- msg->charset() )->toUnicode( msg->asString() );
+ QString str = msg->codec()->toUnicode( msg->asString() );
MailSourceViewer *viewer = new MailSourceViewer(); // deletes itself
upon close
viewer->setCaption( i18n("Message as Plain Text") );
I expect the exact same patch applied to 3.2.3 will fix the problem there.
Ben.
Reply to: