forked from qt-creator/qt-creator
QmlProfiler: fix broken recording logic from the client side
This patch should not be applied back to the master branch,
since the issues are already fixed by b7304e2f2e
.
Task-number: QTCREATORBUG-7091
Change-Id: I6f0b7752f3446b412c5bd9ae6e3d7e1847472e56
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -644,9 +644,14 @@ void QmlProfilerEventList::setTraceStartTime( qint64 time )
|
|||||||
|
|
||||||
void QmlProfilerEventList::complete()
|
void QmlProfilerEventList::complete()
|
||||||
{
|
{
|
||||||
setState(ProcessingData);
|
if (currentState() == AcquiringData) {
|
||||||
d->collectV8Statistics();
|
setState(ProcessingData);
|
||||||
postProcess();
|
d->collectV8Statistics();
|
||||||
|
postProcess();
|
||||||
|
} else {
|
||||||
|
setState(Empty);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlProfilerEventList::QmlProfilerEventListPrivate::clearQmlRootEvent()
|
void QmlProfilerEventList::QmlProfilerEventListPrivate::clearQmlRootEvent()
|
||||||
|
@@ -321,7 +321,7 @@ Rectangle {
|
|||||||
id: elapsedTimer
|
id: elapsedTimer
|
||||||
property date startDate
|
property date startDate
|
||||||
property bool reset: true
|
property bool reset: true
|
||||||
running: connection.recording && connection.enabled
|
running: connection ? (connection.recording && connection.enabled) : false
|
||||||
repeat: true
|
repeat: true
|
||||||
onRunningChanged: {
|
onRunningChanged: {
|
||||||
if (running) reset = true;
|
if (running) reset = true;
|
||||||
|
@@ -533,7 +533,8 @@ QWidget *QmlProfilerTool::createWidgets()
|
|||||||
|
|
||||||
void QmlProfilerTool::connectClient(int port)
|
void QmlProfilerTool::connectClient(int port)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!d->m_client, return;)
|
if (d->m_client)
|
||||||
|
delete d->m_client;
|
||||||
d->m_client = new QDeclarativeDebugConnection;
|
d->m_client = new QDeclarativeDebugConnection;
|
||||||
d->m_traceWindow->reset(d->m_client);
|
d->m_traceWindow->reset(d->m_client);
|
||||||
connect(d->m_client, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
|
connect(d->m_client, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
|
||||||
|
@@ -154,6 +154,8 @@ TraceWindow::TraceWindow(QWidget *parent)
|
|||||||
setMinimumHeight(170);
|
setMinimumHeight(170);
|
||||||
m_currentZoomLevel = 0;
|
m_currentZoomLevel = 0;
|
||||||
m_profiledTime = 0;
|
m_profiledTime = 0;
|
||||||
|
|
||||||
|
initializeQmlViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
TraceWindow::~TraceWindow()
|
TraceWindow::~TraceWindow()
|
||||||
@@ -276,6 +278,14 @@ void TraceWindow::reset(QDeclarativeDebugConnection *conn)
|
|||||||
|
|
||||||
connectClientSignals();
|
connectClientSignals();
|
||||||
|
|
||||||
|
m_v8DataReady = false;
|
||||||
|
m_qmlDataReady = false;
|
||||||
|
|
||||||
|
m_mainView->rootContext()->setContextProperty("connection", m_plugin.data());
|
||||||
|
}
|
||||||
|
|
||||||
|
void TraceWindow::initializeQmlViews()
|
||||||
|
{
|
||||||
m_mainView->rootContext()->setContextProperty("connection", m_plugin.data());
|
m_mainView->rootContext()->setContextProperty("connection", m_plugin.data());
|
||||||
m_mainView->rootContext()->setContextProperty("zoomControl", m_zoomControl.data());
|
m_mainView->rootContext()->setContextProperty("zoomControl", m_zoomControl.data());
|
||||||
m_timebar->rootContext()->setContextProperty("zoomControl", m_zoomControl.data());
|
m_timebar->rootContext()->setContextProperty("zoomControl", m_zoomControl.data());
|
||||||
@@ -307,9 +317,6 @@ void TraceWindow::reset(QDeclarativeDebugConnection *conn)
|
|||||||
|
|
||||||
connect(this, SIGNAL(internalClearDisplay()), m_mainView->rootObject(), SLOT(clearAll()));
|
connect(this, SIGNAL(internalClearDisplay()), m_mainView->rootObject(), SLOT(clearAll()));
|
||||||
connect(this,SIGNAL(internalClearDisplay()), m_overview->rootObject(), SLOT(clearDisplay()));
|
connect(this,SIGNAL(internalClearDisplay()), m_overview->rootObject(), SLOT(clearDisplay()));
|
||||||
|
|
||||||
m_v8DataReady = false;
|
|
||||||
m_qmlDataReady = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TraceWindow::connectClientSignals()
|
void TraceWindow::connectClientSignals()
|
||||||
@@ -476,6 +483,11 @@ void TraceWindow::qmlComplete()
|
|||||||
m_qmlDataReady = true;
|
m_qmlDataReady = true;
|
||||||
if (!m_v8plugin || m_v8plugin.data()->status() != QDeclarativeDebugClient::Enabled || m_v8DataReady) {
|
if (!m_v8plugin || m_v8plugin.data()->status() != QDeclarativeDebugClient::Enabled || m_v8DataReady) {
|
||||||
m_eventList->complete();
|
m_eventList->complete();
|
||||||
|
|
||||||
|
// if no data was received, still notify completion
|
||||||
|
if (m_eventList->currentState() == QmlProfilerEventList::Empty)
|
||||||
|
emit viewUpdated();
|
||||||
|
|
||||||
// once complete is sent, reset the flags
|
// once complete is sent, reset the flags
|
||||||
m_qmlDataReady = false;
|
m_qmlDataReady = false;
|
||||||
m_v8DataReady = false;
|
m_v8DataReady = false;
|
||||||
@@ -487,6 +499,11 @@ void TraceWindow::v8Complete()
|
|||||||
m_v8DataReady = true;
|
m_v8DataReady = true;
|
||||||
if (!m_plugin || m_plugin.data()->status() != QDeclarativeDebugClient::Enabled || m_qmlDataReady) {
|
if (!m_plugin || m_plugin.data()->status() != QDeclarativeDebugClient::Enabled || m_qmlDataReady) {
|
||||||
m_eventList->complete();
|
m_eventList->complete();
|
||||||
|
|
||||||
|
// if no data was received, still notify completion
|
||||||
|
if (m_eventList->currentState() == QmlProfilerEventList::Empty)
|
||||||
|
emit viewUpdated();
|
||||||
|
|
||||||
// once complete is sent, reset the flags
|
// once complete is sent, reset the flags
|
||||||
m_v8DataReady = false;
|
m_v8DataReady = false;
|
||||||
m_qmlDataReady = false;
|
m_qmlDataReady = false;
|
||||||
|
@@ -170,6 +170,7 @@ private:
|
|||||||
QWidget *createZoomToolbar();
|
QWidget *createZoomToolbar();
|
||||||
void connectClientSignals();
|
void connectClientSignals();
|
||||||
void disconnectClientSignals();
|
void disconnectClientSignals();
|
||||||
|
void initializeQmlViews();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void resizeEvent(QResizeEvent *event);
|
virtual void resizeEvent(QResizeEvent *event);
|
||||||
|
Reference in New Issue
Block a user