forked from qt-creator/qt-creator
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:
@@ -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("<");
|
||||
else if (plain.at(i) == QLatin1Char('>'))
|
||||
rich += QLatin1String(">");
|
||||
else if (plain.at(i) == QLatin1Char('&'))
|
||||
rich += QLatin1String("&");
|
||||
else if (plain.at(i) == QLatin1Char('"'))
|
||||
rich += QLatin1String(""");
|
||||
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
|
||||
|
Reference in New Issue
Block a user