summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Schwabauer <Paul Schwabauer pschwabauer@intevation.de>2023-12-01 14:25:44 +0100
committerPaul Schwabauer <Paul Schwabauer pschwabauer@intevation.de>2023-12-01 14:25:44 +0100
commit28c0fec6bb6f92d9c4b83766156ced96553ec246 (patch)
treeb734775a3514e3c91814bff1c941b6eba6ca34fa
parent51d0291b086eede28d1f3b8c1f59affbf4109a99 (diff)
downloadtdepim-bug/94/open-html.tar.gz
tdepim-bug/94/open-html.zip
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>
-rw-r--r--kmail/kmreaderwin.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/kmail/kmreaderwin.cpp b/kmail/kmreaderwin.cpp
index 1e4eab6d..26c5573e 100644
--- a/kmail/kmreaderwin.cpp
+++ b/kmail/kmreaderwin.cpp
@@ -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( "\">" );