From e249265a96e2630c907469b5b40da45df60e91df Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 10 Nov 2011 17:08:07 +0100 Subject: [PATCH] QmlProfiler: Don't let timer run if we cannot connect to port Previously the timer was started as soon as we connect, but we should actually make sure the service is there. Change-Id: Ic59ccb4a402a54dc1fc1f0c92ca2f80dad436581 Reviewed-by: Christiaan Janssen --- src/libs/qmljsdebugclient/qmlprofilertraceclient.cpp | 5 +++++ src/libs/qmljsdebugclient/qmlprofilertraceclient.h | 2 ++ src/plugins/qmlprofiler/qml/MainView.qml | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libs/qmljsdebugclient/qmlprofilertraceclient.cpp b/src/libs/qmljsdebugclient/qmlprofilertraceclient.cpp index f985c0fc5cf..40855c70ebd 100644 --- a/src/libs/qmljsdebugclient/qmlprofilertraceclient.cpp +++ b/src/libs/qmljsdebugclient/qmlprofilertraceclient.cpp @@ -88,6 +88,11 @@ void QmlProfilerTraceClient::clearData() emit cleared(); } +bool QmlProfilerTraceClient::isEnabled() const +{ + return status() == Enabled; +} + bool QmlProfilerTraceClient::isRecording() const { return d->recording; diff --git a/src/libs/qmljsdebugclient/qmlprofilertraceclient.h b/src/libs/qmljsdebugclient/qmlprofilertraceclient.h index e2e01b7087d..0bb7270773e 100644 --- a/src/libs/qmljsdebugclient/qmlprofilertraceclient.h +++ b/src/libs/qmljsdebugclient/qmlprofilertraceclient.h @@ -53,6 +53,7 @@ struct QMLJSDEBUGCLIENT_EXPORT Location class QMLJSDEBUGCLIENT_EXPORT QmlProfilerTraceClient : public QmlJsDebugClient::QDeclarativeDebugClient { Q_OBJECT + Q_PROPERTY(bool enabled READ isEnabled NOTIFY enabled) Q_PROPERTY(bool recording READ isRecording WRITE setRecording NOTIFY recordingChanged) // don't hide by signal @@ -84,6 +85,7 @@ public: MaximumMessage }; + bool isEnabled() const; bool isRecording() const; public slots: diff --git a/src/plugins/qmlprofiler/qml/MainView.qml b/src/plugins/qmlprofiler/qml/MainView.qml index 57484c023f3..e682aeff056 100644 --- a/src/plugins/qmlprofiler/qml/MainView.qml +++ b/src/plugins/qmlprofiler/qml/MainView.qml @@ -297,7 +297,7 @@ Rectangle { id: elapsedTimer property date startDate property bool reset: true - running: connection.recording + running: connection.recording && connection.enabled repeat: true onRunningChanged: { if (running) reset = true;