Adapt to splitting of AbstractTimelineModel

Change-Id: Ib39831448262c5c4329b0f13f62e20d4c3ea73b6
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2014-10-29 10:31:28 +01:00
committed by Ulf Hermann
parent fd09a6bed2
commit d93266420b
9 changed files with 34 additions and 33 deletions

View File

@@ -25,10 +25,10 @@ namespace Internal {
using namespace QmlProfiler;
InputEventsModel::InputEventsModel(QmlProfilerModelManager *manager, QObject *parent)
: AbstractTimelineModel(manager,
tr(QmlProfilerModelManager::featureName(QmlDebug::ProfileInputEvents)),
QmlDebug::Event, QmlDebug::MaximumRangeType, parent),
InputEventsModel::InputEventsModel(QmlProfilerModelManager *manager, QObject *parent) :
QmlProfilerTimelineModel(manager,
tr(QmlProfilerModelManager::featureName(QmlDebug::ProfileInputEvents)),
QmlDebug::Event, QmlDebug::MaximumRangeType, parent),
m_keyTypeId(-1), m_mouseTypeId(-1)
{
announceFeatures(1 << QmlDebug::ProfileInputEvents);
@@ -112,12 +112,12 @@ void InputEventsModel::loadData()
void InputEventsModel::clear()
{
m_keyTypeId = m_mouseTypeId = -1;
AbstractTimelineModel::clear();
QmlProfilerTimelineModel::clear();
}
bool InputEventsModel::accepted(const QmlProfilerDataModel::QmlEventTypeData &event) const
{
return AbstractTimelineModel::accepted(event) &&
return QmlProfilerTimelineModel::accepted(event) &&
(event.detailType == QmlDebug::Mouse || event.detailType == QmlDebug::Key);
}

View File

@@ -19,12 +19,12 @@
#ifndef INPUTEVENTSMODEL_H
#define INPUTEVENTSMODEL_H
#include "qmlprofiler/abstracttimelinemodel.h"
#include "qmlprofiler/qmlprofilertimelinemodel.h"
namespace QmlProfilerExtension {
namespace Internal {
class InputEventsModel : public QmlProfiler::AbstractTimelineModel
class InputEventsModel : public QmlProfiler::QmlProfilerTimelineModel
{
Q_OBJECT

View File

@@ -27,10 +27,10 @@ namespace Internal {
using namespace QmlProfiler;
MemoryUsageModel::MemoryUsageModel(QmlProfilerModelManager *manager, QObject *parent)
: AbstractTimelineModel(manager,
tr(QmlProfilerModelManager::featureName(QmlDebug::ProfileMemory)),
QmlDebug::MemoryAllocation, QmlDebug::MaximumRangeType, parent)
MemoryUsageModel::MemoryUsageModel(QmlProfilerModelManager *manager, QObject *parent) :
QmlProfilerTimelineModel(manager,
tr(QmlProfilerModelManager::featureName(QmlDebug::ProfileMemory)),
QmlDebug::MemoryAllocation, QmlDebug::MaximumRangeType, parent)
{
announceFeatures((1 << QmlDebug::ProfileMemory) | QmlDebug::Constants::QML_JS_RANGE_FEATURES);
}
@@ -242,7 +242,7 @@ void MemoryUsageModel::clear()
{
m_data.clear();
m_maxSize = 1;
AbstractTimelineModel::clear();
QmlProfilerTimelineModel::clear();
}
QString MemoryUsageModel::memoryTypeName(int type)

View File

@@ -19,7 +19,7 @@
#ifndef MEMORYUSAGEMODEL_H
#define MEMORYUSAGEMODEL_H
#include "qmlprofiler/abstracttimelinemodel.h"
#include "qmlprofiler/qmlprofilertimelinemodel.h"
#include "qmlprofiler/qmlprofilerdatamodel.h"
#include <QStringList>
@@ -28,7 +28,7 @@
namespace QmlProfilerExtension {
namespace Internal {
class MemoryUsageModel : public QmlProfiler::AbstractTimelineModel
class MemoryUsageModel : public QmlProfiler::QmlProfilerTimelineModel
{
Q_OBJECT
public:

View File

@@ -25,10 +25,10 @@ namespace Internal {
using namespace QmlProfiler;
PixmapCacheModel::PixmapCacheModel(QmlProfilerModelManager *manager, QObject *parent)
: AbstractTimelineModel(manager,
tr(QmlProfilerModelManager::featureName(QmlDebug::ProfilePixmapCache)),
QmlDebug::PixmapCacheEvent, QmlDebug::MaximumRangeType, parent)
PixmapCacheModel::PixmapCacheModel(QmlProfilerModelManager *manager, QObject *parent) :
QmlProfilerTimelineModel(manager,
tr(QmlProfilerModelManager::featureName(QmlDebug::ProfilePixmapCache)),
QmlDebug::PixmapCacheEvent, QmlDebug::MaximumRangeType, parent)
{
m_maxCacheSize = 1;
announceFeatures(1 << QmlDebug::ProfilePixmapCache);
@@ -39,7 +39,7 @@ int PixmapCacheModel::rowMaxValue(int rowNumber) const
if (rowNumber == 1) {
return m_maxCacheSize;
} else {
return AbstractTimelineModel::rowMaxValue(rowNumber);
return QmlProfilerTimelineModel::rowMaxValue(rowNumber);
}
}
@@ -418,7 +418,7 @@ void PixmapCacheModel::clear()
m_pixmaps.clear();
m_maxCacheSize = 1;
m_data.clear();
AbstractTimelineModel::clear();
QmlProfilerTimelineModel::clear();
}
void PixmapCacheModel::computeMaxCacheSize()

View File

@@ -19,7 +19,7 @@
#ifndef PIXMAPCACHEMODEL_H
#define PIXMAPCACHEMODEL_H
#include "qmlprofiler/abstracttimelinemodel.h"
#include "qmlprofiler/qmlprofilertimelinemodel.h"
#include "qmlprofiler/qmlprofilerdatamodel.h"
#include <QStringList>
@@ -29,7 +29,7 @@
namespace QmlProfilerExtension {
namespace Internal {
class PixmapCacheModel : public QmlProfiler::AbstractTimelineModel
class PixmapCacheModel : public QmlProfiler::QmlProfilerTimelineModel
{
Q_OBJECT
public:

View File

@@ -49,10 +49,10 @@ using namespace QmlProfilerExtension::Internal;
class ModelFactory : public QmlProfiler::QmlProfilerTimelineModelFactory {
Q_OBJECT
public:
QList<QmlProfiler::AbstractTimelineModel *> create(
QList<QmlProfiler::QmlProfilerTimelineModel *> create(
QmlProfiler::QmlProfilerModelManager *manager)
{
QList<QmlProfiler::AbstractTimelineModel *> models;
QList<QmlProfiler::QmlProfilerTimelineModel *> models;
models << new PixmapCacheModel(manager, this)
<< new SceneGraphTimelineModel(manager, this)
<< new MemoryUsageModel(manager, this)

View File

@@ -68,10 +68,11 @@ enum SceneGraphCategoryType {
Q_STATIC_ASSERT(sizeof(StageLabels) ==
SceneGraphTimelineModel::MaximumSceneGraphStage * sizeof(const char *));
SceneGraphTimelineModel::SceneGraphTimelineModel(QmlProfilerModelManager *manager, QObject *parent)
: AbstractTimelineModel(manager,
tr(QmlProfilerModelManager::featureName(QmlDebug::ProfileSceneGraph)),
QmlDebug::SceneGraphFrame, QmlDebug::MaximumRangeType, parent)
SceneGraphTimelineModel::SceneGraphTimelineModel(QmlProfilerModelManager *manager,
QObject *parent) :
QmlProfilerTimelineModel(manager,
tr(QmlProfilerModelManager::featureName(QmlDebug::ProfileSceneGraph)),
QmlDebug::SceneGraphFrame, QmlDebug::MaximumRangeType, parent)
{
announceFeatures(1 << QmlDebug::ProfileSceneGraph);
}
@@ -272,7 +273,7 @@ qint64 SceneGraphTimelineModel::insert(qint64 start, qint64 duration, int typeIn
if (duration <= 0)
return 0;
m_data.insert(AbstractTimelineModel::insert(start, duration, stage),
m_data.insert(QmlProfilerTimelineModel::insert(start, duration, stage),
SceneGraphEvent(typeIndex, glyphCount));
return duration;
}
@@ -291,7 +292,7 @@ const char *SceneGraphTimelineModel::threadLabel(SceneGraphStage stage)
void SceneGraphTimelineModel::clear()
{
m_data.clear();
AbstractTimelineModel::clear();
QmlProfilerTimelineModel::clear();
}
SceneGraphTimelineModel::SceneGraphEvent::SceneGraphEvent(int typeId, int glyphCount) :

View File

@@ -19,7 +19,7 @@
#ifndef SCENEGRAPHTIMELINEMODEL_H
#define SCENEGRAPHTIMELINEMODEL_H
#include "qmlprofiler/abstracttimelinemodel.h"
#include "qmlprofiler/qmlprofilertimelinemodel.h"
#include "qmlprofiler/qmlprofilermodelmanager.h"
#include "qmlprofiler/qmlprofilerdatamodel.h"
@@ -29,7 +29,7 @@
namespace QmlProfilerExtension {
namespace Internal {
class SceneGraphTimelineModel : public QmlProfiler::AbstractTimelineModel
class SceneGraphTimelineModel : public QmlProfiler::QmlProfilerTimelineModel
{
Q_OBJECT
public: