diff --git a/kmreaderwin.cpp b/kmreaderwin.cpp index b1ee362b5..b0c3d845f 100644 --- a/kmreaderwin.cpp +++ b/kmreaderwin.cpp @@ -2887,6 +2887,10 @@ void KMReaderWin::scrollToAttachment( const partNode *node ) } attachmentDiv.setAttribute( "style", QString( "border:2px solid %1" ) .arg( cssHelper()->pgpWarnColor().name() ) ); + + // Update rendering, otherwise the rendering is not updated when the user clicks on an attachment + // that causes scrolling and the open attachment dialog + doc.updateRendering(); } void KMReaderWin::injectAttachments() diff --git a/urlhandlermanager.cpp b/urlhandlermanager.cpp index 00217cc92..1af714f71 100644 --- a/urlhandlermanager.cpp +++ b/urlhandlermanager.cpp @@ -556,9 +556,9 @@ namespace { const bool inHeader = attachmentIsInHeader( url ); const bool shouldShowDialog = !node->isDisplayedEmbedded() || !inHeader; - if ( !shouldShowDialog ) + if ( inHeader ) w->scrollToAttachment( node ); - else + if ( shouldShowDialog ) // PENDING(romain_kdab) : replace with toLocalFile() ? w->openAttachment( node->nodeId(), w->tempFileUrlFromPartNode( node ).path() ); return true;