QmlProfiler: manage server-side start tracing message

also
QmlProfiler: refactor eventlist state

If unexpected data is received, assuming server stopped profiling.
Also, introducing a eventlist state instead of relying on
signals sent around.  This is part of a coming bigger patch
where the profiler client is refactored.

Change-Id: Ibed9007903956daf03cc0fcb90f77b5ad2d3cf90
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
Christiaan Janssen
2012-02-13 15:26:57 +01:00
parent de100a4add
commit 585e651310
15 changed files with 246 additions and 64 deletions

View File

@@ -123,9 +123,9 @@ QmlProfilerEventsWidget::QmlProfilerEventsWidget(QmlJsDebugClient::QmlProfilerEv
groupLayout->addWidget(splitterVertical);
setLayout(groupLayout);
m_eventStatistics = model;
if (model) {
connect(model,SIGNAL(dataReady()),m_eventChildren,SLOT(clear()));
connect(model,SIGNAL(dataReady()),m_eventParents,SLOT(clear()));
connect(model, SIGNAL(stateChanged()), this, SLOT(eventListStateChanged()));
}
m_globalStatsEnabled = true;
@@ -135,6 +135,16 @@ QmlProfilerEventsWidget::~QmlProfilerEventsWidget()
{
}
void QmlProfilerEventsWidget::eventListStateChanged()
{
if (m_eventStatistics) {
QmlProfilerEventList::State newState = m_eventStatistics->currentState();
if (newState == QmlProfilerEventList::Empty) {
clear();
}
}
}
void QmlProfilerEventsWidget::switchToV8View()
{
setObjectName("QmlProfilerV8ProfileView");
@@ -278,16 +288,25 @@ QmlProfilerEventsMainView::~QmlProfilerEventsMainView()
void QmlProfilerEventsMainView::setEventStatisticsModel( QmlProfilerEventList *model )
{
if (d->m_eventStatistics) {
disconnect(d->m_eventStatistics,SIGNAL(dataReady()),this,SLOT(buildModel()));
disconnect(d->m_eventStatistics,SIGNAL(stateChanged()),this,SLOT(eventListStateChanged()));
disconnect(d->m_eventStatistics,SIGNAL(detailsChanged(int,QString)),this,SLOT(changeDetailsForEvent(int,QString)));
}
d->m_eventStatistics = model;
if (model) {
connect(d->m_eventStatistics,SIGNAL(dataReady()),this,SLOT(buildModel()));
connect(d->m_eventStatistics,SIGNAL(stateChanged()),this,SLOT(eventListStateChanged()));
connect(d->m_eventStatistics,SIGNAL(detailsChanged(int,QString)),this,SLOT(changeDetailsForEvent(int,QString)));
}
}
void QmlProfilerEventsMainView::eventListStateChanged()
{
if (d->m_eventStatistics) {
QmlProfilerEventList::State newState = d->m_eventStatistics->currentState();
if (newState == QmlProfilerEventList::Done)
buildModel();
}
}
void QmlProfilerEventsMainView::setFieldViewable(Fields field, bool show)
{
if (field < MaxFields) {