From d93266420b00a226b9286fab09c3eb36d60881dd Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 29 Oct 2014 10:31:28 +0100 Subject: [PATCH] Adapt to splitting of AbstractTimelineModel Change-Id: Ib39831448262c5c4329b0f13f62e20d4c3ea73b6 Reviewed-by: Kai Koehne --- plugins/qmlprofilerextension/inputeventsmodel.cpp | 12 ++++++------ plugins/qmlprofilerextension/inputeventsmodel.h | 4 ++-- plugins/qmlprofilerextension/memoryusagemodel.cpp | 10 +++++----- plugins/qmlprofilerextension/memoryusagemodel.h | 4 ++-- plugins/qmlprofilerextension/pixmapcachemodel.cpp | 12 ++++++------ plugins/qmlprofilerextension/pixmapcachemodel.h | 4 ++-- .../qmlprofilerextensionplugin.cpp | 4 ++-- .../scenegraphtimelinemodel.cpp | 13 +++++++------ .../qmlprofilerextension/scenegraphtimelinemodel.h | 4 ++-- 9 files changed, 34 insertions(+), 33 deletions(-) diff --git a/plugins/qmlprofilerextension/inputeventsmodel.cpp b/plugins/qmlprofilerextension/inputeventsmodel.cpp index 68800be9c96..5de3c8047ba 100644 --- a/plugins/qmlprofilerextension/inputeventsmodel.cpp +++ b/plugins/qmlprofilerextension/inputeventsmodel.cpp @@ -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); } diff --git a/plugins/qmlprofilerextension/inputeventsmodel.h b/plugins/qmlprofilerextension/inputeventsmodel.h index 0af38e93b50..6ed1a4cbe01 100644 --- a/plugins/qmlprofilerextension/inputeventsmodel.h +++ b/plugins/qmlprofilerextension/inputeventsmodel.h @@ -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 diff --git a/plugins/qmlprofilerextension/memoryusagemodel.cpp b/plugins/qmlprofilerextension/memoryusagemodel.cpp index 5f6204a68e0..e144aa77de4 100644 --- a/plugins/qmlprofilerextension/memoryusagemodel.cpp +++ b/plugins/qmlprofilerextension/memoryusagemodel.cpp @@ -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) diff --git a/plugins/qmlprofilerextension/memoryusagemodel.h b/plugins/qmlprofilerextension/memoryusagemodel.h index 6ade0365bd9..bad9af5a10a 100644 --- a/plugins/qmlprofilerextension/memoryusagemodel.h +++ b/plugins/qmlprofilerextension/memoryusagemodel.h @@ -19,7 +19,7 @@ #ifndef MEMORYUSAGEMODEL_H #define MEMORYUSAGEMODEL_H -#include "qmlprofiler/abstracttimelinemodel.h" +#include "qmlprofiler/qmlprofilertimelinemodel.h" #include "qmlprofiler/qmlprofilerdatamodel.h" #include @@ -28,7 +28,7 @@ namespace QmlProfilerExtension { namespace Internal { -class MemoryUsageModel : public QmlProfiler::AbstractTimelineModel +class MemoryUsageModel : public QmlProfiler::QmlProfilerTimelineModel { Q_OBJECT public: diff --git a/plugins/qmlprofilerextension/pixmapcachemodel.cpp b/plugins/qmlprofilerextension/pixmapcachemodel.cpp index c3bfc19f4c0..aa4c20d25eb 100644 --- a/plugins/qmlprofilerextension/pixmapcachemodel.cpp +++ b/plugins/qmlprofilerextension/pixmapcachemodel.cpp @@ -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() diff --git a/plugins/qmlprofilerextension/pixmapcachemodel.h b/plugins/qmlprofilerextension/pixmapcachemodel.h index 5c0160e9bb4..49a7fb5a467 100644 --- a/plugins/qmlprofilerextension/pixmapcachemodel.h +++ b/plugins/qmlprofilerextension/pixmapcachemodel.h @@ -19,7 +19,7 @@ #ifndef PIXMAPCACHEMODEL_H #define PIXMAPCACHEMODEL_H -#include "qmlprofiler/abstracttimelinemodel.h" +#include "qmlprofiler/qmlprofilertimelinemodel.h" #include "qmlprofiler/qmlprofilerdatamodel.h" #include @@ -29,7 +29,7 @@ namespace QmlProfilerExtension { namespace Internal { -class PixmapCacheModel : public QmlProfiler::AbstractTimelineModel +class PixmapCacheModel : public QmlProfiler::QmlProfilerTimelineModel { Q_OBJECT public: diff --git a/plugins/qmlprofilerextension/qmlprofilerextensionplugin.cpp b/plugins/qmlprofilerextension/qmlprofilerextensionplugin.cpp index be7dee83c80..fff0c431f8e 100644 --- a/plugins/qmlprofilerextension/qmlprofilerextensionplugin.cpp +++ b/plugins/qmlprofilerextension/qmlprofilerextensionplugin.cpp @@ -49,10 +49,10 @@ using namespace QmlProfilerExtension::Internal; class ModelFactory : public QmlProfiler::QmlProfilerTimelineModelFactory { Q_OBJECT public: - QList create( + QList create( QmlProfiler::QmlProfilerModelManager *manager) { - QList models; + QList models; models << new PixmapCacheModel(manager, this) << new SceneGraphTimelineModel(manager, this) << new MemoryUsageModel(manager, this) diff --git a/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp b/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp index d0d497e0a2b..596ab5bfdd9 100644 --- a/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp +++ b/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp @@ -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) : diff --git a/plugins/qmlprofilerextension/scenegraphtimelinemodel.h b/plugins/qmlprofilerextension/scenegraphtimelinemodel.h index 204815d9f75..d7a55b66a30 100644 --- a/plugins/qmlprofilerextension/scenegraphtimelinemodel.h +++ b/plugins/qmlprofilerextension/scenegraphtimelinemodel.h @@ -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: