QmlProfiler: Refactor

The code of the qmlprofiler client has become a bit too complex,
this patch reorganizes the modules in a more sensible way,
having the modules communicate with each other through a
state machine instead of the excess of signals and slots
from before.

Change-Id: I76f7313779888a1bd07a1cdb1acbf2e47aacf42a
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
Christiaan Janssen
2012-02-24 10:47:17 +01:00
parent d207165f6a
commit b7304e2f2e
47 changed files with 4742 additions and 3896 deletions

View File

@@ -118,6 +118,16 @@ void QV8ProfilerClient::setRecording(bool v)
emit recordingChanged(v);
}
void QV8ProfilerClient::setRecordingFromServer(bool v)
{
if (v == d->recording)
return;
d->recording = v;
emit recordingChanged(v);
}
void QV8ProfilerClient::statusChanged(Status /*status*/)
{
emit enabledChanged();
@@ -133,7 +143,10 @@ void QV8ProfilerClient::messageReceived(const QByteArray &data)
stream >> messageType;
if (messageType == V8Complete) {
setRecordingFromServer(false);
emit complete();
} else if (messageType == V8ProfilingStarted) {
setRecordingFromServer(true);
} else if (messageType == V8Entry) {
QString filename;
QString function;