From 138b9d7349d5daa1808d8bd891c5ecf817f98c52 Mon Sep 17 00:00:00 2001 From: mread Date: Thu, 13 Oct 2011 14:54:45 +0100 Subject: runonphone timestamps nanosecond formating set to 9 chars, 0 padded runonphone was dropping leading zeros after the decimal point in its timestamp formating. For example [123.000456789] was printed as [123.456789], which is quite a different number. The formatting now pads the nanoseconds component with leading zeros to 9 characters. Timestamps are now always displayed with a 9 character nanoseconds component, with leading and trailing zeros as appropriate. For example: [1897.070556640] [Qt Message] QEglContext::swapBuffers Reviewed-by: Shane Kearns --- tools/runonphone/symbianutils/launcher.cpp | 2 +- tools/runonphone/texttracehandler.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/runonphone/symbianutils/launcher.cpp b/tools/runonphone/symbianutils/launcher.cpp index ff67881..2909696 100644 --- a/tools/runonphone/symbianutils/launcher.cpp +++ b/tools/runonphone/symbianutils/launcher.cpp @@ -440,7 +440,7 @@ void Launcher::handleResult(const TrkResult &result) quint64 timestamp = extractInt64(result.data) & 0x0FFFFFFFFFFFFFFFULL; quint64 secs = timestamp / 1000000000; quint64 ns = timestamp % 1000000000; - msg = QString("[%1.%2] %3").arg(secs).arg(ns).arg(QString(result.data.mid(8))); + msg = QString("[%1.%2] %3").arg(secs).arg(ns,9,10,QLatin1Char('0')).arg(QString(result.data.mid(8))); logMessage("TEXT TRACE: " + msg); } } else { diff --git a/tools/runonphone/texttracehandler.cpp b/tools/runonphone/texttracehandler.cpp index fff02e9..a121c08 100644 --- a/tools/runonphone/texttracehandler.cpp +++ b/tools/runonphone/texttracehandler.cpp @@ -85,5 +85,5 @@ void TextTraceHandler::dataAvailable() secs = timestamp / 1000000000; ns = timestamp % 1000000000; } - d->out << QString("[%1.%2] %3").arg(secs).arg(ns).arg(QString(result.mid(8))) << endl; + d->out << QString("[%1.%2] %3").arg(secs).arg(ns,9,10,QLatin1Char('0')).arg(QString(result.mid(8))) << endl; } -- cgit v0.12