diff options
author | Christiaan Janssen <christiaan.janssen@nokia.com> | 2012-02-01 16:47:26 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-02 01:14:50 +0100 |
commit | d19be6639999970105820d690952fee5b8e874ec (patch) | |
tree | f97459d69288ae24279f14844622539e6585b126 /src | |
parent | 540031dd8bbbff7bbb05bd2801bb0e92e3274bba (diff) |
QmlProfiling: don't send v8 data if not profiling
Change-Id: I41085ed06bcf28e9de0a72f25076b91b9a3b2aea
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/debugger/qv8profilerservice.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/declarative/debugger/qv8profilerservice.cpp b/src/declarative/debugger/qv8profilerservice.cpp index 988ac65bfd..3abec3f6a2 100644 --- a/src/declarative/debugger/qv8profilerservice.cpp +++ b/src/declarative/debugger/qv8profilerservice.cpp @@ -97,6 +97,7 @@ public: QList<QV8ProfilerData> m_data; bool initialized; + bool m_enabled; }; QV8ProfilerService::QV8ProfilerService(QObject *parent) @@ -104,6 +105,8 @@ QV8ProfilerService::QV8ProfilerService(QObject *parent) { Q_D(QV8ProfilerService); + d->m_enabled = false; + if (registerService() == Enabled) { // ,block mode, client attached while (!d->initialized) @@ -138,11 +141,13 @@ void QV8ProfilerService::messageReceived(const QByteArray &message) if (command == "V8PROFILER") { ds >> title; - if (option == "start") { + if (option == "start" && !d->m_enabled) { QMetaObject::invokeMethod(this, "startProfiling", Qt::QueuedConnection, Q_ARG(QString, QString::fromUtf8(title))); - } else if (option == "stop") { + d->m_enabled = true; + } else if (option == "stop" && d->m_enabled) { QMetaObject::invokeMethod(this, "stopProfiling", Qt::QueuedConnection, Q_ARG(QString, QString::fromUtf8(title))); QMetaObject::invokeMethod(this, "sendProfilingData", Qt::QueuedConnection); + d->m_enabled = false; } d->initialized = true; } |