Commit 4fc3990b authored by Christiaan Janssen's avatar Christiaan Janssen
Browse files

QmlProfiler: fixed connection reset when new application starts

Reviewed-by: Kai Koehne
parent 4a098509
......@@ -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 {
......
......@@ -90,7 +90,7 @@ private slots:
private:
void connectToClient();
void resetWindow();
void updateRecordingState();
class QmlProfilerToolPrivate;
QmlProfilerToolPrivate *d;
......
......@@ -333,7 +333,8 @@ void TraceWindow::clearDisplay()
void TraceWindow::setRecording(bool recording)
{
m_plugin.data()->setRecording(recording);
if (m_plugin)
m_plugin.data()->setRecording(recording);
}
bool TraceWindow::isRecording() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment