forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user