Commit 25f00f99 authored by hjk's avatar hjk Committed by Christian Kandeler
Browse files

debugger: un-duplicate code



No need for a copy of Qt::escape.

Change-Id: Id4bf0b8d09485375a41a728f0cc6ceca91c9fb42
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent 903c3caf
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "watchutils.h" #include "watchutils.h"
#include <QTextStream> #include <QTextStream>
#include <QTextDocument>
#include <QDebug> #include <QDebug>
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
...@@ -43,25 +44,6 @@ ...@@ -43,25 +44,6 @@
namespace Debugger { namespace Debugger {
namespace Internal { 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) bool isPointerType(const QByteArray &type)
{ {
return type.endsWith('*') || type.endsWith("* const"); return type.endsWith('*') || type.endsWith("* const");
...@@ -369,7 +351,7 @@ static void formatToolTipRow(QTextStream &str, ...@@ -369,7 +351,7 @@ static void formatToolTipRow(QTextStream &str,
const QString &category, const QString &value) const QString &category, const QString &value)
{ {
str << "<tr><td>" << category << "</td><td> : </td><td>" str << "<tr><td>" << category << "</td><td> : </td><td>"
<< htmlEscape(value) << "</td></tr>"; << Qt::escape(value) << "</td></tr>";
} }
QString WatchData::toToolTip() const QString WatchData::toToolTip() const
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment