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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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