From e78cf511472a06caa686b1de0bbacbb564b9e54c Mon Sep 17 00:00:00 2001 From: Till Adam Date: Mon, 17 Jan 2005 10:58:45 +0000 Subject: [PATCH] Backport from HEAD of: CVS commit by tilladam: Don't show unknown attachments in an extra view source window but in the main reader win which is opened anyhow. svn path=/branches/proko2/kdepim/; revision=379366 --- kmreaderwin.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kmreaderwin.cpp b/kmreaderwin.cpp index 883abcdc7..ce335a493 100644 --- a/kmreaderwin.cpp +++ b/kmreaderwin.cpp @@ -1804,7 +1804,9 @@ void KMReaderWin::setMsgPart( KMMessagePart* aMsgPart, bool aHTML, setCaption( i18n("View Attachment: %1").arg( pname ) ); show(); } else { - MailSourceViewer *viewer = new MailSourceViewer(); // deletes itself + htmlWriter()->begin( mCSSHelper->cssDefinitions( isFixedFont() ) ); + htmlWriter()->queue( mCSSHelper->htmlHead( isFixedFont() ) ); + QString str = aMsgPart->bodyDecoded(); // A QString cannot handle binary data. So if it's shorter than the // attachment, we assume the attachment is binary: @@ -1813,9 +1815,10 @@ void KMReaderWin::setMsgPart( KMMessagePart* aMsgPart, bool aHTML, "[KMail: Attachment contains binary data. Trying to show first %n characters.]", str.length()); } - viewer->setText(str); - viewer->resize(500, 550); - viewer->show(); + htmlWriter()->write( QStyleSheet::escape( str ) ); + htmlWriter()->queue(""); + htmlWriter()->flush(); + mMainWindow->setCaption(i18n("View Attachment: %1").arg(pname)); } // ---Sven's view text, html and image attachments in html widget end --- }