QmlProfiler: fixed connection reset when new application starts

Reviewed-by: Kai Koehne
This commit is contained in:
Christiaan Janssen
2011-04-15 14:51:49 +02:00
parent 4a0985093c
commit 4fc3990b53
3 changed files with 6 additions and 5 deletions

View File

@@ -294,6 +294,7 @@ void QmlProfilerTool::connectClient()
{
QTC_ASSERT(!d->m_client, return;)
d->m_client = new QDeclarativeDebugConnection;
d->m_traceWindow->reset(d->m_client);
connect(d->m_client, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
this, SLOT(connectionStateChanged()));
d->m_connectionTimer.start();
@@ -461,7 +462,7 @@ void QmlProfilerTool::connectionStateChanged()
{
if (QmlProfilerPlugin::debugOutput)
qWarning("QmlProfiler: connected and running");
resetWindow();
updateRecordingState();
break;
}
case QAbstractSocket::ClosingState:
@@ -474,9 +475,8 @@ void QmlProfilerTool::connectionStateChanged()
}
}
void QmlProfilerTool::resetWindow()
void QmlProfilerTool::updateRecordingState()
{
d->m_traceWindow->reset(d->m_client);
if (d->m_client->isConnected()) {
d->m_traceWindow->setRecording(d->m_recordingEnabled);
} else {