From: José Fonseca Date: Thu, 5 Apr 2012 19:06:42 +0000 (+0100) Subject: Disable BlockingIODevice with QJSON. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=95b4056d6a126a90e8e4e046e250ee4d75a1e8db;p=apitrace Disable BlockingIODevice with QJSON. It looks like it doesn't work reliably in all cases, at least with certain versions. --- diff --git a/gui/retracer.cpp b/gui/retracer.cpp index 84f9742..983cd1a 100644 --- a/gui/retracer.cpp +++ b/gui/retracer.cpp @@ -283,8 +283,6 @@ void Retracer::run() /* * Parse JSON from the output. * - * XXX: QJSON expects blocking IO. - * * XXX: QJSON's scanner is inneficient as it abuses single * character QIODevice::peek (not cheap), instead of maintaining a * lookahead character on its own. @@ -292,7 +290,16 @@ void Retracer::run() bool ok = false; QJson::Parser jsonParser; +#if 0 parsedJson = jsonParser.parse(&io, &ok).toMap(); +#else + /* + * XXX: QJSON expects blocking IO, and it looks like + * BlockingIODevice does not work reliably in all cases. + */ + process.waitForFinished(-1); + parsedJson = jsonParser.parse(&process, &ok).toMap(); +#endif if (!ok) { msg = QLatin1String("failed to parse JSON"); }