forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user