analyzer: htlm-escape function names before showing them as html

Templates tend to contain things like < and >.

Change-Id: Ia947f6fd9d49df81aa1e9b5041ef2dabd75769f6
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2012-08-22 21:48:34 +02:00
parent 596ce92dd4
commit 40cbc6746c

View File

@@ -39,6 +39,7 @@
#include <QChar> #include <QChar>
#include <QDebug> #include <QDebug>
#include <QStringList> #include <QStringList>
#include <QTextDocument>
#include <QVector> #include <QVector>
namespace Valgrind { namespace Valgrind {
@@ -250,7 +251,7 @@ QVariant DataModel::data(const QModelIndex &index, int role) const
// body, function info first // body, function info first
ret += "<body><dl>"; ret += "<body><dl>";
ret += "<dt>" + tr("Function:") + "</dt><dd>" + func->name() + "</dd>\n"; ret += "<dt>" + tr("Function:") + "</dt><dd>" + Qt::escape(func->name()) + "</dd>\n";
ret += "<dt>" + tr("File:") + "</dt><dd>" + func->file() + "</dd>\n"; ret += "<dt>" + tr("File:") + "</dt><dd>" + func->file() + "</dd>\n";
if (!func->costItems().isEmpty()) { if (!func->costItems().isEmpty()) {
const CostItem *firstItem = func->costItems().first(); const CostItem *firstItem = func->costItems().first();