HTML emails can't be opened because they are not written to disk. This
fixes it by writing all parts of the email unconditionally to disk and
adds a '.html' file extension if the part is of type HTML.
Signed-off-by: Paul Schwabauer <Paul Schwabauer pschwabauer@intevation.de>
bug/94/open-html
Paul Schwabauer 6 months ago
parent 51d0291b08
commit 28c0fec6bb

@ -1775,8 +1775,12 @@ TQString KMReaderWin::writeMessagePartToTempFile( KMMessagePart* aMsgPart,
int slashPos = fileName.findRev( '/' );
if( -1 != slashPos )
fileName = fileName.mid( slashPos + 1 );
if( fileName.isEmpty() )
if( fileName.isEmpty() ) {
fileName = "unnamed";
// Save html emails with extension
if (aMsgPart->subtype() == DwMime::kSubtypeHtml )
fileName += ".html";
}
fname += "/" + fileName;
TQByteArray data = aMsgPart->bodyDecodedBinary();
@ -3041,11 +3045,11 @@ TQString KMReaderWin::renderAttachments(partNode * node, const TQColor &bgColor
html += "</div>";
}
} else {
TQString fileName = writeMessagePartToTempFile( &node->msgPart(), node->nodeId() );
partNode::AttachmentDisplayInfo info = node->attachmentDisplayInfo();
if ( info.displayInHeader ) {
html += "<div style=\"float:left;\">";
html += TQString::fromLatin1( "<span style=\"white-space:nowrap; border-width: 0px; border-left-width: 5px; border-color: %1; 2px; border-left-style: solid;\">" ).arg( bgColor.name() );
TQString fileName = writeMessagePartToTempFile( &node->msgPart(), node->nodeId() );
TQString href = node->asHREF( "header" );
html += TQString::fromLatin1( "<a href=\"" ) + href +
TQString::fromLatin1( "\">" );

Loading…
Cancel
Save