Skip to content
Permalink
Browse files

legend: truncate excessively long tooltips (fixes #21737)

  • Loading branch information
jef-n committed Apr 2, 2019
1 parent c638255 commit 2ef99da242feb4013a8abe4ebb543b0f1b3b11f2
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/core/layertree/qgslayertreemodel.cpp
@@ -330,7 +330,13 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
parts << QString();
}

parts << "<i>" + layer->publicSource().toHtmlEscaped() + "</i>";
QString source( layer->publicSource() );
if ( source.size() > 1024 )
{
source = source.left( 1023 ) + QStringLiteral( "" );
}

parts << "<i>" + source.toHtmlEscaped() + "</i>";

return parts.join( QStringLiteral( "<br/>" ) );
}

0 comments on commit 2ef99da

Please sign in to comment.
You can’t perform that action at this time.