diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2015-05-27 12:27:52 +0100 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2015-05-27 12:27:52 +0100 |
commit | 59fb19b770d1037e9149c224dda42d96fba39da4 (patch) | |
tree | 8aaa72afd80c4f860a899faab8083568bc41c965 /gui | |
parent | f46f1e37f4e79eb3095933e7fa44eb7ad7401944 (diff) |
gui: Try to un-break android retracer.
Which must have gotten with the UBJSON transition.
Untested, but at least it has a non-zero chance of working.
Ideally, this code should have been shared with gui/retracer.cpp instead
of duplicated.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/androidretracer.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/gui/androidretracer.cpp b/gui/androidretracer.cpp index 7dc738be..de70606d 100644 --- a/gui/androidretracer.cpp +++ b/gui/androidretracer.cpp @@ -8,9 +8,11 @@ #include "trace_profiler.hpp" #include <QHostAddress> -#include <QJsonDocument> #include <QSettings> #include <QTime> +#include <QBuffer> + +#include "qubjson.h" typedef QLatin1String _; @@ -120,7 +122,7 @@ void AndroidRetracer::run() QRegExp regexp("(^\\d+): +(\\b\\w+\\b): ([^\\r\\n]+)[\\r\\n]*$"); QString msg = QLatin1String("Replay finished!"); - QByteArray jsonBuffer; + QByteArray ubjsonBuffer; QByteArray outputBuffer; bool keepGoing = true; while(keepGoing) { @@ -182,7 +184,7 @@ void AndroidRetracer::run() // read stdout channel if (stdoutSocket.waitForReadyRead(100)) { if (captureState()) - jsonBuffer.append(stdoutSocket.readAll()); + ubjsonBuffer.append(stdoutSocket.readAll()); else if (captureThumbnails()) { // read one image image::PNMInfo info; @@ -268,14 +270,10 @@ void AndroidRetracer::run() msg = outputBuffer; if (captureState()) { - QJsonParseError error; - QJsonDocument jsonDoc = - QJsonDocument::fromJson(jsonBuffer, &error); - - if (error.error != QJsonParseError::NoError) - msg = error.errorString(); + QBuffer io(&ubjsonBuffer); + io.open(QIODevice::ReadOnly); - parsedJson = jsonDoc.toVariant().toMap(); + parsedJson = decodeUBJSONObject(&io).toMap(); ApiTraceState *state = new ApiTraceState(parsedJson); emit foundState(state); } |