QmlProfiler: Fix the naming scheme for events and event types

Move them out of the QmlProfilerDataModel class, drop the "Data"
suffix, and rename symbols that refer to them in order to call them by
their names.

Change-Id: I41151359921b325edb79111371083c4185bd148b
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-04-26 11:50:59 +02:00
parent 08f807a134
commit a955537132
28 changed files with 540 additions and 452 deletions

View File

@@ -57,7 +57,7 @@ struct Colors {
QColor defaultBackground;
};
struct RootEventType : public QmlProfilerDataModel::QmlEventTypeData {
struct RootEventType : public QmlEventType {
RootEventType()
{
QString rootEventName = QmlProfilerStatisticsMainView::tr("<program>");
@@ -555,8 +555,7 @@ void QmlProfilerStatisticsMainView::buildModel()
void QmlProfilerStatisticsMainView::updateNotes(int typeIndex)
{
const QHash<int, QmlProfilerStatisticsModel::QmlEventStats> &eventList =
d->model->getData();
const QHash<int, QmlProfilerStatisticsModel::QmlEventStats> &eventList = d->model->getData();
const QHash<int, QString> &noteList = d->model->getNotes();
QStandardItem *parentItem = d->m_model->invisibleRootItem();
@@ -585,17 +584,15 @@ void QmlProfilerStatisticsMainView::updateNotes(int typeIndex)
void QmlProfilerStatisticsMainView::parseModel()
{
const QHash<int, QmlProfilerStatisticsModel::QmlEventStats> &eventList =
d->model->getData();
const QVector<QmlProfilerDataModel::QmlEventTypeData> &typeList = d->model->getTypes();
const QHash<int, QmlProfilerStatisticsModel::QmlEventStats> &eventList = d->model->getData();
const QVector<QmlEventType> &typeList = d->model->getTypes();
QHash<int, QmlProfilerStatisticsModel::QmlEventStats>::ConstIterator it;
for (it = eventList.constBegin(); it != eventList.constEnd(); ++it) {
int typeIndex = it.key();
const QmlProfilerStatisticsModel::QmlEventStats &stats = it.value();
const QmlProfilerDataModel::QmlEventTypeData &event =
(typeIndex != -1 ? typeList[typeIndex] : *rootEventType());
const QmlEventType &event = (typeIndex != -1 ? typeList[typeIndex] : *rootEventType());
QStandardItem *parentItem = d->m_model->invisibleRootItem();
QList<QStandardItem *> newRow;
@@ -889,14 +886,13 @@ void QmlProfilerStatisticsRelativesView::rebuildTree(
treeModel()->clear();
QStandardItem *topLevelItem = treeModel()->invisibleRootItem();
const QVector<QmlProfilerDataModel::QmlEventTypeData> &typeList = d->model->getTypes();
const QVector<QmlEventType> &typeList = d->model->getTypes();
QmlProfilerStatisticsRelativesModel::QmlStatisticsRelativesMap::const_iterator it;
for (it = map.constBegin(); it != map.constEnd(); ++it) {
const QmlProfilerStatisticsRelativesModel::QmlStatisticsRelativesData &event = it.value();
int typeIndex = it.key();
const QmlProfilerDataModel::QmlEventTypeData &type =
(typeIndex != -1 ? typeList[typeIndex] : *rootEventType());
const QmlEventType &type = (typeIndex != -1 ? typeList[typeIndex] : *rootEventType());
QList<QStandardItem *> newRow;
// ToDo: here we were going to search for the data in the other model