debugger: cleanup

This commit is contained in:
hjk
2011-04-08 15:38:50 +02:00
parent e7441dab12
commit 63ebdb3623
4 changed files with 45 additions and 77 deletions

View File

@@ -45,13 +45,6 @@
namespace Debugger {
namespace Internal {
enum GuessChildrenResult
{
HasChildren,
HasNoChildren,
HasPossiblyChildren
};
static QString htmlEscape(const QString &plain)
{
QString rich;
@@ -127,19 +120,6 @@ bool isIntOrFloatType(const QByteArray &type)
return isIntType(type) || isFloatType(type);
}
GuessChildrenResult guessChildren(const QByteArray &type)
{
if (isIntOrFloatType(type))
return HasNoChildren;
if (isCharPointerType(type))
return HasNoChildren;
if (isPointerType(type))
return HasChildren;
if (type.endsWith("QString"))
return HasNoChildren;
return HasPossiblyChildren;
}
WatchData::WatchData() :
id(0),
state(InitialState),
@@ -234,6 +214,21 @@ void WatchData::setValueToolTip(const QString &tooltip)
valuetooltip = tooltip;
}
enum GuessChildrenResult { HasChildren, HasNoChildren, HasPossiblyChildren };
static GuessChildrenResult guessChildren(const QByteArray &type)
{
if (isIntOrFloatType(type))
return HasNoChildren;
if (isCharPointerType(type))
return HasNoChildren;
if (isPointerType(type))
return HasChildren;
if (type.endsWith("QString"))
return HasNoChildren;
return HasPossiblyChildren;
}
void WatchData::setType(const QByteArray &str, bool guessChildrenFromType)
{
type = str.trimmed();