QmlProfiler: Don't expose the vector of event types

We always want either the total number of event types or one specific
type. There is no need to expose the fact that we keep them as a vector.

Also, use int as the type of the "number" methods as that aligns better
with Qt containers, and rename the methods. We don't need to state the
fact that we've loaded the events and types at some point.

Change-Id: Iaf680ec9fa10e1070ddee6bcc079800e401775f0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Ulf Hermann
2018-03-28 09:42:28 +02:00
parent 7ca958fa85
commit dcd8d37f35
19 changed files with 77 additions and 66 deletions

View File

@@ -117,7 +117,7 @@ void QmlProfilerStateWidget::updateDisplay()
if (d->m_profilerState->serverRecording()) {
// Heuristic to not show the number if the application will only send the events when it
// stops. The number is still > 0 then because we get some StartTrace etc.
uint numEvents = d->m_modelManager->numLoadedEvents();
uint numEvents = d->m_modelManager->numEvents();
showText(numEvents > 256 ? tr("Profiling application: %n events", 0, numEvents) :
tr("Profiling application"));
return;
@@ -136,7 +136,7 @@ void QmlProfilerStateWidget::updateDisplay()
if (state == QmlProfilerModelManager::AcquiringData) {
// we don't know how much more, so progress numbers are strange here
showText(tr("Loading buffered data: %n events", 0,
d->m_modelManager->numLoadedEvents()));
d->m_modelManager->numEvents()));
} else if (state == QmlProfilerModelManager::ClearingData) {
// when starting a second recording from the same process without aggregation
showText(tr("Clearing old trace"));
@@ -144,7 +144,7 @@ void QmlProfilerStateWidget::updateDisplay()
} else if (state == QmlProfilerModelManager::AcquiringData) {
// Application died before all data could be read
showText(tr("Loading offline data: %n events", 0,
d->m_modelManager->numLoadedEvents()));
d->m_modelManager->numEvents()));
} else if (state == QmlProfilerModelManager::ClearingData) {
showText(tr("Clearing old trace"));
}