From 25f00f99eaab72eb7759656a939f5b27dd4a8575 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 4 Sep 2012 12:19:16 +0200 Subject: [PATCH] debugger: un-duplicate code No need for a copy of Qt::escape. Change-Id: Id4bf0b8d09485375a41a728f0cc6ceca91c9fb42 Reviewed-by: Christian Kandeler --- src/plugins/debugger/watchdata.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/plugins/debugger/watchdata.cpp b/src/plugins/debugger/watchdata.cpp index 96bcedeecc1..7fe10e58397 100644 --- a/src/plugins/debugger/watchdata.cpp +++ b/src/plugins/debugger/watchdata.cpp @@ -32,6 +32,7 @@ #include "watchutils.h" #include +#include #include //////////////////////////////////////////////////////////////////// @@ -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 << "" << category << " : " - << htmlEscape(value) << ""; + << Qt::escape(value) << ""; } QString WatchData::toToolTip() const