aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlprofiler/qmlprofilerclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qmlprofiler/qmlprofilerclient.cpp')
-rw-r--r--tools/qmlprofiler/qmlprofilerclient.cpp41
1 files changed, 4 insertions, 37 deletions
diff --git a/tools/qmlprofiler/qmlprofilerclient.cpp b/tools/qmlprofiler/qmlprofilerclient.cpp
index 711ddbd862..b752a75941 100644
--- a/tools/qmlprofiler/qmlprofilerclient.cpp
+++ b/tools/qmlprofiler/qmlprofilerclient.cpp
@@ -39,17 +39,12 @@
ProfilerClient::ProfilerClient(const QString &clientName,
QQmlDebugConnection *client)
: QQmlDebugClient(clientName, client),
- m_recording(false),
m_enabled(false)
{
}
ProfilerClient::~ProfilerClient()
{
- //Disable profiling if started by client
- //Profiling data will be lost!!
- if (isRecording())
- setRecording(false);
}
void ProfilerClient::clearData()
@@ -62,29 +57,6 @@ bool ProfilerClient::isEnabled() const
return m_enabled;
}
-void ProfilerClient::sendRecordingStatus()
-{
-}
-
-bool ProfilerClient::isRecording() const
-{
- return m_recording;
-}
-
-void ProfilerClient::setRecording(bool v)
-{
- if (v == m_recording)
- return;
-
- m_recording = v;
-
- if (state() == Enabled) {
- sendRecordingStatus();
- }
-
- emit recordingChanged(v);
-}
-
void ProfilerClient::stateChanged(State status)
{
if ((m_enabled && status != Enabled) ||
@@ -135,11 +107,11 @@ void QmlProfilerClient::clearData()
ProfilerClient::clearData();
}
-void QmlProfilerClient::sendRecordingStatus()
+void QmlProfilerClient::sendRecordingStatus(bool record)
{
QByteArray ba;
QDataStream stream(&ba, QIODevice::WriteOnly);
- stream << isRecording();
+ stream << record;
sendMessage(ba);
}
@@ -296,19 +268,14 @@ V8ProfilerClient::~V8ProfilerClient()
{
}
-void V8ProfilerClient::sendRecordingStatus()
+void V8ProfilerClient::sendRecordingStatus(bool record)
{
QByteArray ba;
QDataStream stream(&ba, QIODevice::WriteOnly);
QByteArray cmd("V8PROFILER");
- QByteArray option("");
+ QByteArray option(record ? "start" : "stop");
QByteArray title("");
- if (m_recording) {
- option = "start";
- } else {
- option = "stop";
- }
stream << cmd << option << title;
sendMessage(ba);
}