QmlProfiler: Move the data structs of the V8 model into the model class

QmlProfilerDataModel does it the same way and we don't pollute the
namespace as much like this.

Change-Id: Id1ed2c444cb2556fb8f1c886a754e51f3eae5772
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-02-18 17:40:58 +01:00
parent 58e3c9ed05
commit abcb7b0604
4 changed files with 50 additions and 49 deletions

View File

@@ -263,7 +263,7 @@ class QV8ProfilerEventsMainView::QV8ProfilerEventsMainViewPrivate
public:
QV8ProfilerEventsMainViewPrivate(QV8ProfilerEventsMainView *qq) : q(qq) {}
void buildV8ModelFromList( const QList<QV8EventData *> &list );
void buildV8ModelFromList( const QList<QV8ProfilerDataModel::QV8EventData *> &list );
int getFieldCount();
QString textForItem(QStandardItem *item, bool recursive) const;
@@ -428,10 +428,11 @@ void QV8ProfilerEventsMainView::buildModel()
collapseAll();
}
void QV8ProfilerEventsMainView::QV8ProfilerEventsMainViewPrivate::buildV8ModelFromList(const QList<QV8EventData *> &list)
void QV8ProfilerEventsMainView::QV8ProfilerEventsMainViewPrivate::buildV8ModelFromList(
const QList<QV8ProfilerDataModel::QV8EventData *> &list)
{
for (int index = 0; index < list.count(); index++) {
QV8EventData *v8event = list.at(index);
QV8ProfilerDataModel::QV8EventData *v8event = list.at(index);
QList<QStandardItem *> newRow;
if (m_fieldShown[Name])
@@ -639,10 +640,10 @@ QV8ProfilerEventRelativesView::~QV8ProfilerEventRelativesView()
void QV8ProfilerEventRelativesView::displayEvent(int index)
{
QV8EventData *event = m_v8Model->v8EventDescription(index);
QV8ProfilerDataModel::QV8EventData *event = m_v8Model->v8EventDescription(index);
QTC_CHECK(event);
QList<QV8EventSub*> events;
QList<QV8ProfilerDataModel::QV8EventSub*> events;
if (m_type == ParentsView)
events = event->parentHash.values();
else
@@ -656,13 +657,13 @@ void QV8ProfilerEventRelativesView::displayEvent(int index)
sortByColumn(1);
}
void QV8ProfilerEventRelativesView::rebuildTree(QList<QV8EventSub*> events)
void QV8ProfilerEventRelativesView::rebuildTree(QList<QV8ProfilerDataModel::QV8EventSub*> events)
{
clear();
QStandardItem *topLevelItem = m_model->invisibleRootItem();
foreach (QV8EventSub *event, events) {
foreach (QV8ProfilerDataModel::QV8EventSub *event, events) {
QList<QStandardItem *> newRow;
newRow << new EventsViewItem(event->reference->displayName);
newRow << new EventsViewItem(QmlProfilerBaseModel::formatTime(event->totalTime));