diff --git a/kmcommands.cpp b/kmcommands.cpp index 7ff1c9ec8..435e79723 100644 --- a/kmcommands.cpp +++ b/kmcommands.cpp @@ -867,9 +867,11 @@ void KMSaveMsgCommand::slotSaveResult(KIO::Job *job) //----------------------------------------------------------------------------- -KMOpenMsgCommand::KMOpenMsgCommand( QWidget *parent, const KURL & url ) +KMOpenMsgCommand::KMOpenMsgCommand( QWidget *parent, const KURL & url, + const QTextCodec *codec ) : KMCommand( parent ), - mUrl( url ) + mUrl( url ), + mCodec( codec ) { setDeletesItself( true ); } @@ -958,7 +960,7 @@ void KMOpenMsgCommand::slotResult( KIO::Job *job ) KMMessage *msg = new KMMessage( dwMsg ); msg->setReadyToShow( true ); KMReaderMainWin *win = new KMReaderMainWin(); - win->showMsg( kmkernel->networkCodec(), msg ); + win->showMsg( mCodec, msg ); win->show(); if ( multipleMessages ) KMessageBox::information( win, diff --git a/kmcommands.h b/kmcommands.h index 8eeb7e0e8..3313b44ae 100644 --- a/kmcommands.h +++ b/kmcommands.h @@ -331,7 +331,8 @@ class KDE_EXPORT KMOpenMsgCommand : public KMCommand Q_OBJECT public: - KMOpenMsgCommand( QWidget *parent, const KURL & url = KURL() ); + KMOpenMsgCommand( QWidget *parent, const KURL & url = KURL(), + const QTextCodec *codec = 0 ); private: virtual Result execute(); @@ -345,6 +346,7 @@ private: KURL mUrl; DwString mMsgString; KIO::TransferJob *mJob; + const QTextCodec *mCodec; }; class KDE_EXPORT KMSaveAttachmentsCommand : public KMCommand diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index 6ab620534..2208c217e 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -1586,7 +1586,7 @@ void KMMainWidget::slotSaveMsg() //----------------------------------------------------------------------------- void KMMainWidget::slotOpenMsg() { - KMOpenMsgCommand *openCommand = new KMOpenMsgCommand( this ); + KMOpenMsgCommand *openCommand = new KMOpenMsgCommand( this, 0, mCodec ); openCommand->start(); }