debugger: un-duplicate code

No need for a copy of Qt::escape.

Change-Id: Id4bf0b8d09485375a41a728f0cc6ceca91c9fb42
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
hjk
2012-09-04 12:19:16 +02:00
committed by Christian Kandeler
parent 903c3cafe8
commit 25f00f99ea

View File

@@ -32,6 +32,7 @@
#include "watchutils.h"
#include <QTextStream>
#include <QTextDocument>
#include <QDebug>
////////////////////////////////////////////////////////////////////
@@ -43,25 +44,6 @@
namespace Debugger {
namespace Internal {
static QString htmlEscape(const QString &plain)
{
QString rich;
rich.reserve(int(plain.length() * 1.1));
for (int i = 0; i < plain.length(); ++i) {
if (plain.at(i) == QLatin1Char('<'))
rich += QLatin1String("&lt;");
else if (plain.at(i) == QLatin1Char('>'))
rich += QLatin1String("&gt;");
else if (plain.at(i) == QLatin1Char('&'))
rich += QLatin1String("&amp;");
else if (plain.at(i) == QLatin1Char('"'))
rich += QLatin1String("&quot;");
else
rich += plain.at(i);
}
return rich;
}
bool isPointerType(const QByteArray &type)
{
return type.endsWith('*') || type.endsWith("* const");
@@ -369,7 +351,7 @@ static void formatToolTipRow(QTextStream &str,
const QString &category, const QString &value)
{
str << "<tr><td>" << category << "</td><td> : </td><td>"
<< htmlEscape(value) << "</td></tr>";
<< Qt::escape(value) << "</td></tr>";
}
QString WatchData::toToolTip() const