forked from qt-creator/qt-creator
QmlProfiler: Don't emit recordingChanged signal if service gets enabled
Change-Id: I1cba56b92d83edb2ed54b731f9815c77d04cfd9e Reviewed-on: http://codereview.qt.nokia.com/3500 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
This commit is contained in:
@@ -36,14 +36,18 @@ namespace QmlJsDebugClient {
|
|||||||
|
|
||||||
class QmlProfilerTraceClientPrivate {
|
class QmlProfilerTraceClientPrivate {
|
||||||
public:
|
public:
|
||||||
QmlProfilerTraceClientPrivate()
|
QmlProfilerTraceClientPrivate(QmlProfilerTraceClient *_q)
|
||||||
: inProgressRanges(0)
|
: q(_q)
|
||||||
|
, inProgressRanges(0)
|
||||||
, maximumTime(0)
|
, maximumTime(0)
|
||||||
, recording(false)
|
, recording(false)
|
||||||
{
|
{
|
||||||
::memset(rangeCount, 0, MaximumQmlEventType * sizeof(int));
|
::memset(rangeCount, 0, MaximumQmlEventType * sizeof(int));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sendRecordingStatus();
|
||||||
|
|
||||||
|
QmlProfilerTraceClient *q;
|
||||||
qint64 inProgressRanges;
|
qint64 inProgressRanges;
|
||||||
QStack<qint64> rangeStartTimes[MaximumQmlEventType];
|
QStack<qint64> rangeStartTimes[MaximumQmlEventType];
|
||||||
QStack<QStringList> rangeDatas[MaximumQmlEventType];
|
QStack<QStringList> rangeDatas[MaximumQmlEventType];
|
||||||
@@ -59,9 +63,17 @@ using namespace QmlJsDebugClient;
|
|||||||
|
|
||||||
static const int GAP_TIME = 150;
|
static const int GAP_TIME = 150;
|
||||||
|
|
||||||
|
void QmlProfilerTraceClientPrivate::sendRecordingStatus()
|
||||||
|
{
|
||||||
|
QByteArray ba;
|
||||||
|
QDataStream stream(&ba, QIODevice::WriteOnly);
|
||||||
|
stream << recording;
|
||||||
|
q->sendMessage(ba);
|
||||||
|
}
|
||||||
|
|
||||||
QmlProfilerTraceClient::QmlProfilerTraceClient(QDeclarativeDebugConnection *client)
|
QmlProfilerTraceClient::QmlProfilerTraceClient(QDeclarativeDebugConnection *client)
|
||||||
: QDeclarativeDebugClient(QLatin1String("CanvasFrameRate"), client)
|
: QDeclarativeDebugClient(QLatin1String("CanvasFrameRate"), client)
|
||||||
, d(new QmlProfilerTraceClientPrivate)
|
, d(new QmlProfilerTraceClientPrivate(this))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,22 +98,19 @@ void QmlProfilerTraceClient::setRecording(bool v)
|
|||||||
if (v == d->recording)
|
if (v == d->recording)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
d->recording = v;
|
||||||
|
|
||||||
if (status() == Enabled) {
|
if (status() == Enabled) {
|
||||||
QByteArray ba;
|
d->sendRecordingStatus();
|
||||||
QDataStream stream(&ba, QIODevice::WriteOnly);
|
|
||||||
stream << v;
|
|
||||||
sendMessage(ba);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
d->recording = v;
|
|
||||||
emit recordingChanged(v);
|
emit recordingChanged(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlProfilerTraceClient::statusChanged(Status status)
|
void QmlProfilerTraceClient::statusChanged(Status status)
|
||||||
{
|
{
|
||||||
if (status == Enabled) {
|
if (status == Enabled) {
|
||||||
d->recording = !d->recording;
|
d->sendRecordingStatus();
|
||||||
setRecording(!d->recording);
|
|
||||||
emit enabled();
|
emit enabled();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user