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

@@ -79,7 +79,7 @@ public:
int numRegisteredModels = 0;
int numFinishedFinalizers = 0;
uint numLoadedEvents = 0;
int numLoadedEvents = 0;
quint64 availableFeatures = 0;
quint64 visibleFeatures = 0;
quint64 recordedFeatures = 0;
@@ -183,12 +183,12 @@ bool QmlProfilerModelManager::isEmpty() const
return d->file.pos() == 0;
}
uint QmlProfilerModelManager::numLoadedEvents() const
int QmlProfilerModelManager::numEvents() const
{
return d->numLoadedEvents;
}
uint QmlProfilerModelManager::numLoadedEventTypes() const
int QmlProfilerModelManager::numEventTypes() const
{
return d->eventTypes.count();
}
@@ -254,9 +254,9 @@ void QmlProfilerModelManager::addEventType(const QmlEventType &type)
}
}
const QVector<QmlEventType> &QmlProfilerModelManager::eventTypes() const
const QmlEventType &QmlProfilerModelManager::eventType(int typeId) const
{
return d->eventTypes;
return d->eventTypes.at(typeId);
}
static bool isStateful(const QmlEventType &type)