Debugger: Use DebuggerCommand in QML engine

... instead of manually set up JSON. It's more concise, and paves the
way to use per-command callbacks as in the other engines.

Change-Id: Ib5cf9c9b882ec0ec87acd7c1ceb938d3ee60346b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2015-07-10 11:06:27 +02:00
parent 90985d18c0
commit 92f4ea3f79
3 changed files with 116 additions and 176 deletions

View File

@@ -782,6 +782,16 @@ void DebuggerCommand::arg(const char *name, const char *value)
args.append("\",");
}
void DebuggerCommand::arg(const char *name, const QList<int> &list)
{
beginList(name);
foreach (int item, list) {
args.append(QByteArray::number(item));
args.append(',');
}
endList();
}
void DebuggerCommand::arg(const char *value)
{
args.append("\"");
@@ -823,5 +833,13 @@ void DebuggerCommand::endGroup()
args += "},";
}
QByteArray DebuggerCommand::arguments() const
{
QByteArray result = args;
if (result.endsWith(','))
result.chop(1);
return result;
}
} // namespace Internal
} // namespace Debugger