Navigation Menu

Skip to content

Commit

Permalink
[processing] Fix certain characters show as HTML escaped in processin…
Browse files Browse the repository at this point in the history
…g log

Fixes #37934
  • Loading branch information
nyalldawson committed Sep 17, 2020
1 parent 92d0ec5 commit 965595d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/processing/qgsprocessingalgorithmdialogbase.cpp
Expand Up @@ -653,12 +653,14 @@ QString QgsProcessingAlgorithmDialogBase::formatStringForLog( const QString &str

void QgsProcessingAlgorithmDialogBase::setInfo( const QString &message, bool isError, bool escapeHtml )
{
// note -- we have to wrap the message in a span block, or QTextEdit::append sometimes gets confused
// and varies between treating it as a HTML string or a plain text string! (see https://github.com/qgis/QGIS/issues/37934)
if ( isError )
txtLog->append( QStringLiteral( "<span style=\"color:red\">%1</span>" ).arg( escapeHtml ? formatStringForLog( message.toHtmlEscaped() ) : formatStringForLog( message ) ) );
else if ( escapeHtml )
txtLog->append( formatStringForLog( message.toHtmlEscaped() ) );
txtLog->append( QStringLiteral( "<span>%1</span" ).arg( formatStringForLog( message.toHtmlEscaped() ) ) );
else
txtLog->append( formatStringForLog( message ) );
txtLog->append( QStringLiteral( "<span>%1</span>" ).arg( formatStringForLog( message ) ) );
scrollToBottomOfLog();
processEvents();
}
Expand Down

0 comments on commit 965595d

Please sign in to comment.