From a42e07bebaf6a161020459a66aab021cb0e29f90 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 27 Oct 2014 17:41:22 +0100 Subject: [PATCH] QmlProfiler: Rename some classes and files to follow the common pattern The ones we'll refactor into the timeline library should be called timeline* and the others should be called qmlprofiler*. Change-Id: I6ecccbe4ef523681ca0baeef140368e2c1839964 Reviewed-by: Kai Koehne --- src/plugins/qmlprofiler/qmlprofiler.pro | 108 +++++++++--------- src/plugins/qmlprofiler/qmlprofiler.qbs | 7 +- ...oxy.cpp => qmlprofileranimationsmodel.cpp} | 56 ++++----- ...elproxy.h => qmlprofileranimationsmodel.h} | 14 +-- .../qmlprofiler/qmlprofilerdatamodel.cpp | 2 +- .../qmlprofilereventsmodelproxy.cpp | 2 +- .../qmlprofiler/qmlprofilereventsmodelproxy.h | 2 +- .../qmlprofiler/qmlprofilermodelmanager.cpp | 8 +- .../qmlprofiler/qmlprofilermodelmanager.h | 4 +- ...tesmodel.cpp => qmlprofilernotesmodel.cpp} | 45 ++++---- .../{notesmodel.h => qmlprofilernotesmodel.h} | 4 +- ...delproxy.cpp => qmlprofilerrangemodel.cpp} | 68 +++++------ ...nemodelproxy.h => qmlprofilerrangemodel.h} | 14 +-- src/plugins/qmlprofiler/qmlprofilertool.cpp | 2 +- .../qmlprofiler/qmlprofilertraceview.cpp | 1 - .../qmlprofiler/timelinemodelaggregator.cpp | 14 +-- .../qmlprofiler/timelinemodelaggregator.h | 2 +- src/plugins/qmlprofiler/timelinerenderer.cpp | 4 +- src/plugins/qmlprofiler/timelinerenderer.h | 1 - 19 files changed, 178 insertions(+), 180 deletions(-) rename src/plugins/qmlprofiler/{qmlprofilerpainteventsmodelproxy.cpp => qmlprofileranimationsmodel.cpp} (83%) rename src/plugins/qmlprofiler/{qmlprofilerpainteventsmodelproxy.h => qmlprofileranimationsmodel.h} (88%) rename src/plugins/qmlprofiler/{notesmodel.cpp => qmlprofilernotesmodel.cpp} (81%) rename src/plugins/qmlprofiler/{notesmodel.h => qmlprofilernotesmodel.h} (96%) rename src/plugins/qmlprofiler/{qmlprofilertimelinemodelproxy.cpp => qmlprofilerrangemodel.cpp} (83%) rename src/plugins/qmlprofiler/{qmlprofilertimelinemodelproxy.h => qmlprofilerrangemodel.h} (89%) diff --git a/src/plugins/qmlprofiler/qmlprofiler.pro b/src/plugins/qmlprofiler/qmlprofiler.pro index cb6bb5f86c9..8b2ec8aef51 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.pro +++ b/src/plugins/qmlprofiler/qmlprofiler.pro @@ -5,70 +5,70 @@ QT += network qml quick include(../../qtcreatorplugin.pri) SOURCES += \ - qmlprofilerplugin.cpp \ - qmlprofilertool.cpp \ - qmlprofilerengine.cpp \ - qmlprofilerattachdialog.cpp \ - localqmlprofilerrunner.cpp \ - qmlprofilereventview.cpp \ - qv8profilereventview.cpp \ - qmlprofilerdetailsrewriter.cpp \ - qmlprofilertraceview.cpp \ - timelinerenderer.cpp \ - qmlprofilerstatemanager.cpp \ - qv8profilerdatamodel.cpp \ - qmlprofilerclientmanager.cpp \ - qmlprofilerviewmanager.cpp \ - qmlprofilerstatewidget.cpp \ - qmlprofilerruncontrolfactory.cpp \ - qmlprofilermodelmanager.cpp \ - qmlprofilereventsmodelproxy.cpp \ - qmlprofilertimelinemodelproxy.cpp \ - qmlprofilertreeview.cpp \ - qmlprofilertracefile.cpp \ abstracttimelinemodel.cpp \ - timelinemodelaggregator.cpp \ - qmlprofilerpainteventsmodelproxy.cpp \ - sortedtimelinemodel.cpp \ + localqmlprofilerrunner.cpp \ + qmlprofileranimationsmodel.cpp \ + qmlprofilerattachdialog.cpp \ qmlprofilerbasemodel.cpp \ + qmlprofilerclientmanager.cpp \ qmlprofilerdatamodel.cpp \ - notesmodel.cpp \ + qmlprofilerdetailsrewriter.cpp \ + qmlprofilerengine.cpp \ + qmlprofilereventsmodelproxy.cpp \ + qmlprofilereventview.cpp \ + qmlprofilermodelmanager.cpp \ + qmlprofilernotesmodel.cpp \ + qmlprofilerplugin.cpp \ + qmlprofilerrangemodel.cpp \ + qmlprofilerruncontrolfactory.cpp \ + qmlprofilerstatemanager.cpp \ + qmlprofilerstatewidget.cpp \ + qmlprofilertool.cpp \ + qmlprofilertracefile.cpp \ + qmlprofilertraceview.cpp \ + qmlprofilertreeview.cpp \ + qmlprofilerviewmanager.cpp \ + qv8profilerdatamodel.cpp \ + qv8profilereventview.cpp \ + sortedtimelinemodel.cpp \ + timelinemodelaggregator.cpp \ + timelinerenderer.cpp \ timelinezoomcontrol.cpp HEADERS += \ - qmlprofilerconstants.h \ - qmlprofiler_global.h \ - qmlprofilerplugin.h \ - qmlprofilertool.h \ - qmlprofilerengine.h \ - qmlprofilerattachdialog.h \ abstractqmlprofilerrunner.h \ - localqmlprofilerrunner.h \ - qmlprofilereventview.h \ - qv8profilereventview.h \ - qmlprofilerdetailsrewriter.h \ - qmlprofilertraceview.h \ - timelinerenderer.h \ - qmlprofilerstatemanager.h \ - qv8profilerdatamodel.h \ - qmlprofilerclientmanager.h \ - qmlprofilerviewmanager.h \ - qmlprofilerstatewidget.h \ - qmlprofilerruncontrolfactory.h \ - qmlprofilermodelmanager.h \ - qmlprofilereventsmodelproxy.h \ - qmlprofilertimelinemodelproxy.h \ - qmlprofilertreeview.h \ - qmlprofilertracefile.h \ abstracttimelinemodel.h \ - timelinemodelaggregator.h \ - qmlprofilerpainteventsmodelproxy.h \ - sortedtimelinemodel.h \ - qmlprofilerbasemodel.h \ abstracttimelinemodel_p.h \ - qmlprofilerdatamodel.h \ + localqmlprofilerrunner.h \ + qmlprofiler_global.h \ + qmlprofileranimationsmodel.h \ + qmlprofilerattachdialog.h \ + qmlprofilerbasemodel.h \ qmlprofilerbasemodel_p.h \ - notesmodel.h \ + qmlprofilerclientmanager.h \ + qmlprofilerconstants.h \ + qmlprofilerdatamodel.h \ + qmlprofilerdetailsrewriter.h \ + qmlprofilerengine.h \ + qmlprofilereventsmodelproxy.h \ + qmlprofilereventview.h \ + qmlprofilermodelmanager.h \ + qmlprofilernotesmodel.h \ + qmlprofilerplugin.h \ + qmlprofilerrangemodel.h \ + qmlprofilerruncontrolfactory.h \ + qmlprofilerstatemanager.h \ + qmlprofilerstatewidget.h \ + qmlprofilertool.h \ + qmlprofilertracefile.h \ + qmlprofilertraceview.h \ + qmlprofilertreeview.h \ + qmlprofilerviewmanager.h \ + qv8profilerdatamodel.h \ + qv8profilereventview.h \ + sortedtimelinemodel.h \ + timelinemodelaggregator.h \ + timelinerenderer.h \ timelinezoomcontrol.h RESOURCES += \ diff --git a/src/plugins/qmlprofiler/qmlprofiler.qbs b/src/plugins/qmlprofiler/qmlprofiler.qbs index 184cd9a0876..67f01cb424b 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.qbs +++ b/src/plugins/qmlprofiler/qmlprofiler.qbs @@ -23,9 +23,8 @@ QtcPlugin { "abstractqmlprofilerrunner.h", "abstracttimelinemodel.h", "abstracttimelinemodel_p.h", "abstracttimelinemodel.cpp", "localqmlprofilerrunner.cpp", "localqmlprofilerrunner.h", - "notesmodel.cpp", - "notesmodel.h", "qmlprofiler_global.h", + "qmlprofileranimationsmodel.h", "qmlprofileranimationsmodel.cpp", "qmlprofilerattachdialog.cpp", "qmlprofilerattachdialog.h", "qmlprofilerbasemodel.cpp", "qmlprofilerbasemodel.h", "qmlprofilerbasemodel_p.h", "qmlprofilerclientmanager.cpp", "qmlprofilerclientmanager.h", @@ -36,12 +35,12 @@ QtcPlugin { "qmlprofilereventsmodelproxy.cpp", "qmlprofilereventsmodelproxy.h", "qmlprofilereventview.cpp", "qmlprofilereventview.h", "qmlprofilermodelmanager.cpp", "qmlprofilermodelmanager.h", - "qmlprofilerpainteventsmodelproxy.h", "qmlprofilerpainteventsmodelproxy.cpp", + "qmlprofilernotesmodel.cpp", "qmlprofilernotesmodel.h", "qmlprofilerplugin.cpp", "qmlprofilerplugin.h", "qmlprofilerruncontrolfactory.cpp", "qmlprofilerruncontrolfactory.h", "qmlprofilerstatemanager.cpp", "qmlprofilerstatemanager.h", "qmlprofilerstatewidget.cpp", "qmlprofilerstatewidget.h", - "qmlprofilertimelinemodelproxy.cpp", "qmlprofilertimelinemodelproxy.h", + "qmlprofilerrangemodel.cpp", "qmlprofilerrangemodel.h", "qmlprofilertool.cpp", "qmlprofilertool.h", "qmlprofilertracefile.cpp", "qmlprofilertracefile.h", "qmlprofilertraceview.cpp", "qmlprofilertraceview.h", diff --git a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp similarity index 83% rename from src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp rename to src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp index c29e2d38018..147cb21f3d5 100644 --- a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp +++ b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp @@ -28,7 +28,7 @@ ** ****************************************************************************/ -#include "qmlprofilerpainteventsmodelproxy.h" +#include "qmlprofileranimationsmodel.h" #include "qmlprofilermodelmanager.h" #include "qmlprofilerdatamodel.h" #include "abstracttimelinemodel_p.h" @@ -46,49 +46,49 @@ namespace QmlProfiler { namespace Internal { -class PaintEventsModelProxy::PaintEventsModelProxyPrivate : public AbstractTimelineModelPrivate +class QmlProfilerAnimationsModel::QmlProfilerAnimationsModelPrivate : public AbstractTimelineModelPrivate { public: - QVector data; + QVector data; int maxGuiThreadAnimations; int maxRenderThreadAnimations; int rowFromThreadId(QmlDebug::AnimationThread threadId) const; private: - Q_DECLARE_PUBLIC(PaintEventsModelProxy) + Q_DECLARE_PUBLIC(QmlProfilerAnimationsModel) }; -PaintEventsModelProxy::PaintEventsModelProxy(QObject *parent) - : AbstractTimelineModel(new PaintEventsModelProxyPrivate, +QmlProfilerAnimationsModel::QmlProfilerAnimationsModel(QObject *parent) + : AbstractTimelineModel(new QmlProfilerAnimationsModelPrivate, tr(QmlProfilerModelManager::featureName(QmlDebug::ProfileAnimations)), QmlDebug::Event, QmlDebug::MaximumRangeType, parent) { - Q_D(PaintEventsModelProxy); + Q_D(QmlProfilerAnimationsModel); d->maxGuiThreadAnimations = d->maxRenderThreadAnimations = 0; } -quint64 PaintEventsModelProxy::features() const +quint64 QmlProfilerAnimationsModel::features() const { return 1 << QmlDebug::ProfileAnimations; } -void PaintEventsModelProxy::clear() +void QmlProfilerAnimationsModel::clear() { - Q_D(PaintEventsModelProxy); + Q_D(QmlProfilerAnimationsModel); d->maxGuiThreadAnimations = d->maxRenderThreadAnimations = 0; d->data.clear(); AbstractTimelineModel::clear(); } -bool PaintEventsModelProxy::accepted(const QmlProfilerDataModel::QmlEventTypeData &event) const +bool QmlProfilerAnimationsModel::accepted(const QmlProfilerDataModel::QmlEventTypeData &event) const { return AbstractTimelineModel::accepted(event) && event.detailType== QmlDebug::AnimationFrame; } -void PaintEventsModelProxy::loadData() +void QmlProfilerAnimationsModel::loadData() { - Q_D(PaintEventsModelProxy); + Q_D(QmlProfilerAnimationsModel); clear(); QmlProfilerDataModel *simpleModel = d->modelManager->qmlModel(); if (simpleModel->isEmpty()) @@ -149,21 +149,21 @@ void PaintEventsModelProxy::loadData() /////////////////// QML interface -int PaintEventsModelProxy::PaintEventsModelProxyPrivate::rowFromThreadId( +int QmlProfilerAnimationsModel::QmlProfilerAnimationsModelPrivate::rowFromThreadId( QmlDebug::AnimationThread threadId) const { return (threadId == QmlDebug::GuiThread || maxGuiThreadAnimations == 0) ? 1 : 2; } -int PaintEventsModelProxy::row(int index) const +int QmlProfilerAnimationsModel::row(int index) const { - Q_D(const PaintEventsModelProxy); + Q_D(const QmlProfilerAnimationsModel); return d->rowFromThreadId(d->data[index].threadId); } -int PaintEventsModelProxy::rowMaxValue(int rowNumber) const +int QmlProfilerAnimationsModel::rowMaxValue(int rowNumber) const { - Q_D(const PaintEventsModelProxy); + Q_D(const QmlProfilerAnimationsModel); switch (rowNumber) { case 1: return d->maxGuiThreadAnimations > 0 ? d->maxGuiThreadAnimations : @@ -175,15 +175,15 @@ int PaintEventsModelProxy::rowMaxValue(int rowNumber) const } } -int PaintEventsModelProxy::selectionId(int index) const +int QmlProfilerAnimationsModel::selectionId(int index) const { - Q_D(const PaintEventsModelProxy); + Q_D(const QmlProfilerAnimationsModel); return d->data[index].threadId; } -QColor PaintEventsModelProxy::color(int index) const +QColor QmlProfilerAnimationsModel::color(int index) const { - Q_D(const PaintEventsModelProxy); + Q_D(const QmlProfilerAnimationsModel); double fpsFraction = d->data[index].framerate / 60.0; if (fpsFraction > 1.0) fpsFraction = 1.0; @@ -192,9 +192,9 @@ QColor PaintEventsModelProxy::color(int index) const return colorByFraction(fpsFraction); } -float PaintEventsModelProxy::relativeHeight(int index) const +float QmlProfilerAnimationsModel::relativeHeight(int index) const { - Q_D(const PaintEventsModelProxy); + Q_D(const QmlProfilerAnimationsModel); const QmlPaintEventData &data = d->data[index]; // Add some height to the events if we're far from the scale threshold of 2 * DefaultRowHeight. @@ -207,9 +207,9 @@ float PaintEventsModelProxy::relativeHeight(int index) const d->maxRenderThreadAnimations); } -QVariantList PaintEventsModelProxy::labels() const +QVariantList QmlProfilerAnimationsModel::labels() const { - Q_D(const PaintEventsModelProxy); + Q_D(const QmlProfilerAnimationsModel); QVariantList result; if (!d->hidden && d->maxGuiThreadAnimations > 0) { @@ -231,9 +231,9 @@ QVariantList PaintEventsModelProxy::labels() const return result; } -QVariantMap PaintEventsModelProxy::details(int index) const +QVariantMap QmlProfilerAnimationsModel::details(int index) const { - Q_D(const PaintEventsModelProxy); + Q_D(const QmlProfilerAnimationsModel); QVariantMap result; result.insert(QStringLiteral("displayName"), displayName()); diff --git a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.h similarity index 88% rename from src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h rename to src/plugins/qmlprofiler/qmlprofileranimationsmodel.h index d520bfb7c51..92fb8d43017 100644 --- a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h +++ b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.h @@ -29,8 +29,8 @@ ****************************************************************************/ -#ifndef QMLPROFILERPAINTEVENTSMODELPROXY_H -#define QMLPROFILERPAINTEVENTSMODELPROXY_H +#ifndef QMLPROFILERANIMATIONSMODEL_H +#define QMLPROFILERANIMATIONSMODEL_H #include #include "abstracttimelinemodel.h" @@ -49,7 +49,7 @@ class QmlProfilerModelManager; namespace Internal { -class PaintEventsModelProxy : public AbstractTimelineModel +class QmlProfilerAnimationsModel : public AbstractTimelineModel { Q_OBJECT public: @@ -60,7 +60,7 @@ public: QmlDebug::AnimationThread threadId; }; - PaintEventsModelProxy(QObject *parent = 0); + QmlProfilerAnimationsModel(QObject *parent = 0); int rowMaxValue(int rowNumber) const; @@ -81,11 +81,11 @@ protected: void clear(); private: - class PaintEventsModelProxyPrivate; - Q_DECLARE_PRIVATE(PaintEventsModelProxy) + class QmlProfilerAnimationsModelPrivate; + Q_DECLARE_PRIVATE(QmlProfilerAnimationsModel) }; } } -#endif +#endif // QMLPROFILERANIMATIONSMODEL_H diff --git a/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp b/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp index 9bda889b76b..694ede70fba 100644 --- a/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp @@ -31,7 +31,7 @@ #include "qmlprofilerdatamodel.h" #include "qmlprofilerbasemodel_p.h" #include "qmlprofilermodelmanager.h" -#include "notesmodel.h" +#include "qmlprofilernotesmodel.h" #include #include #include diff --git a/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp b/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp index b371d13f2a3..a8646266090 100644 --- a/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp +++ b/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp @@ -138,7 +138,7 @@ void QmlProfilerEventsModelProxy::dataChanged() void QmlProfilerEventsModelProxy::notesChanged(int typeIndex) { - const NotesModel *notesModel = d->modelManager->notesModel(); + const QmlProfilerNotesModel *notesModel = d->modelManager->notesModel(); if (typeIndex == -1) { d->notes.clear(); for (int noteId = 0; noteId < notesModel->count(); ++noteId) { diff --git a/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.h b/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.h index f5e6146c574..4654734d581 100644 --- a/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.h +++ b/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.h @@ -33,7 +33,7 @@ #define QMLPROFILEREVENTSMODELPROXY_H #include "qmlprofilerdatamodel.h" -#include "notesmodel.h" +#include "qmlprofilernotesmodel.h" #include #include #include diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp index 09e8a0b5893..18c3b152b07 100644 --- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp @@ -32,7 +32,7 @@ #include "qmlprofilerdatamodel.h" #include "qv8profilerdatamodel.h" #include "qmlprofilertracefile.h" -#include "notesmodel.h" +#include "qmlprofilernotesmodel.h" #include @@ -171,7 +171,7 @@ public: QmlProfilerDataModel *model; QV8ProfilerDataModel *v8Model; - NotesModel *notesModel; + QmlProfilerNotesModel *notesModel; QmlProfilerDataState *dataState; QmlProfilerTraceTime *traceTime; @@ -198,7 +198,7 @@ QmlProfilerModelManager::QmlProfilerModelManager(Utils::FileInProjectFinder *fin d->v8Model = new QV8ProfilerDataModel(finder, this); d->dataState = new QmlProfilerDataState(this, this); d->traceTime = new QmlProfilerTraceTime(this); - d->notesModel = new NotesModel(this); + d->notesModel = new QmlProfilerNotesModel(this); d->notesModel->setModelManager(this); } @@ -222,7 +222,7 @@ QV8ProfilerDataModel *QmlProfilerModelManager::v8Model() const return d->v8Model; } -NotesModel *QmlProfilerModelManager::notesModel() const +QmlProfilerNotesModel *QmlProfilerModelManager::notesModel() const { return d->notesModel; } diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h index bb1f190623f..b942b0f726f 100644 --- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h +++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h @@ -43,7 +43,7 @@ namespace QmlProfiler { class QmlProfilerModelManager; class QmlProfilerDataModel; class QV8ProfilerDataModel; -class NotesModel; +class QmlProfilerNotesModel; namespace Internal { @@ -119,7 +119,7 @@ public: QmlProfilerTraceTime *traceTime() const; QmlProfilerDataModel *qmlModel() const; QV8ProfilerDataModel *v8Model() const; - NotesModel *notesModel() const; + QmlProfilerNotesModel *notesModel() const; bool isEmpty() const; int count() const; diff --git a/src/plugins/qmlprofiler/notesmodel.cpp b/src/plugins/qmlprofiler/qmlprofilernotesmodel.cpp similarity index 81% rename from src/plugins/qmlprofiler/notesmodel.cpp rename to src/plugins/qmlprofiler/qmlprofilernotesmodel.cpp index 57fb4867009..96641ff2b19 100644 --- a/src/plugins/qmlprofiler/notesmodel.cpp +++ b/src/plugins/qmlprofiler/qmlprofilernotesmodel.cpp @@ -28,32 +28,33 @@ ** ****************************************************************************/ -#include "notesmodel.h" +#include "qmlprofilernotesmodel.h" namespace QmlProfiler { -NotesModel::NotesModel(QObject *parent) : QObject(parent), m_modelManager(0), m_modified(false) +QmlProfilerNotesModel::QmlProfilerNotesModel(QObject *parent) : QObject(parent), m_modelManager(0), + m_modified(false) { } -int NotesModel::count() const +int QmlProfilerNotesModel::count() const { return m_data.count(); } -void NotesModel::setModelManager(QmlProfilerModelManager *modelManager) +void QmlProfilerNotesModel::setModelManager(QmlProfilerModelManager *modelManager) { m_modelManager = modelManager; } -void NotesModel::addTimelineModel(const AbstractTimelineModel *timelineModel) +void QmlProfilerNotesModel::addTimelineModel(const AbstractTimelineModel *timelineModel) { connect(timelineModel, &AbstractTimelineModel::destroyed, - this, &NotesModel::removeTimelineModel); + this, &QmlProfilerNotesModel::removeTimelineModel); m_timelineModels.insert(timelineModel->modelId(), timelineModel); } -int NotesModel::typeId(int index) const +int QmlProfilerNotesModel::typeId(int index) const { const Note ¬e = m_data[index]; auto it = m_timelineModels.find(note.timelineModel); @@ -62,22 +63,22 @@ int NotesModel::typeId(int index) const return it.value()->typeId(note.timelineIndex); } -QString NotesModel::text(int index) const +QString QmlProfilerNotesModel::text(int index) const { return m_data[index].text; } -int NotesModel::timelineModel(int index) const +int QmlProfilerNotesModel::timelineModel(int index) const { return m_data[index].timelineModel; } -int NotesModel::timelineIndex(int index) const +int QmlProfilerNotesModel::timelineIndex(int index) const { return m_data[index].timelineIndex; } -QVariantList NotesModel::byTypeId(int selectedType) const +QVariantList QmlProfilerNotesModel::byTypeId(int selectedType) const { QVariantList ret; for (int noteId = 0; noteId < count(); ++noteId) { @@ -87,7 +88,7 @@ QVariantList NotesModel::byTypeId(int selectedType) const return ret; } -QVariantList NotesModel::byTimelineModel(int timelineModel) const +QVariantList QmlProfilerNotesModel::byTimelineModel(int timelineModel) const { QVariantList ret; for (int noteId = 0; noteId < count(); ++noteId) { @@ -97,7 +98,7 @@ QVariantList NotesModel::byTimelineModel(int timelineModel) const return ret; } -int NotesModel::get(int timelineModel, int timelineIndex) const +int QmlProfilerNotesModel::get(int timelineModel, int timelineIndex) const { for (int noteId = 0; noteId < count(); ++noteId) { const Note ¬e = m_data[noteId]; @@ -108,7 +109,7 @@ int NotesModel::get(int timelineModel, int timelineIndex) const return -1; } -int NotesModel::add(int timelineModel, int timelineIndex, const QString &text) +int QmlProfilerNotesModel::add(int timelineModel, int timelineIndex, const QString &text) { const AbstractTimelineModel *model = m_timelineModels[timelineModel]; int typeId = model->range(timelineIndex).typeId; @@ -119,7 +120,7 @@ int NotesModel::add(int timelineModel, int timelineIndex, const QString &text) return m_data.count() - 1; } -void NotesModel::update(int index, const QString &text) +void QmlProfilerNotesModel::update(int index, const QString &text) { Note ¬e = m_data[index]; if (text != note.text) { @@ -129,7 +130,7 @@ void NotesModel::update(int index, const QString &text) } } -void NotesModel::remove(int index) +void QmlProfilerNotesModel::remove(int index) { Note ¬e = m_data[index]; int noteType = typeId(index); @@ -140,12 +141,12 @@ void NotesModel::remove(int index) emit changed(noteType, timelineModel, timelineIndex); } -bool NotesModel::isModified() const +bool QmlProfilerNotesModel::isModified() const { return m_modified; } -void NotesModel::removeTimelineModel(QObject *timelineModel) +void QmlProfilerNotesModel::removeTimelineModel(QObject *timelineModel) { for (auto i = m_timelineModels.begin(); i != m_timelineModels.end();) { if (i.value() == timelineModel) @@ -155,7 +156,7 @@ void NotesModel::removeTimelineModel(QObject *timelineModel) } } -int NotesModel::add(int typeId, qint64 start, qint64 duration, const QString &text) +int QmlProfilerNotesModel::add(int typeId, qint64 start, qint64 duration, const QString &text) { int timelineModel = -1; int timelineIndex = -1; @@ -188,14 +189,14 @@ int NotesModel::add(int typeId, qint64 start, qint64 duration, const QString &te return m_data.count() - 1; } -void NotesModel::clear() +void QmlProfilerNotesModel::clear() { m_data.clear(); m_modified = false; emit changed(-1, -1, -1); } -void NotesModel::loadData() +void QmlProfilerNotesModel::loadData() { m_data.clear(); const QVector ¬es = @@ -208,7 +209,7 @@ void NotesModel::loadData() emit changed(-1, -1, -1); } -void NotesModel::saveData() +void QmlProfilerNotesModel::saveData() { QVector notes; for (int i = 0; i < count(); ++i) { diff --git a/src/plugins/qmlprofiler/notesmodel.h b/src/plugins/qmlprofiler/qmlprofilernotesmodel.h similarity index 96% rename from src/plugins/qmlprofiler/notesmodel.h rename to src/plugins/qmlprofiler/qmlprofilernotesmodel.h index 0722e4ef8a4..65f331fb4c0 100644 --- a/src/plugins/qmlprofiler/notesmodel.h +++ b/src/plugins/qmlprofiler/qmlprofilernotesmodel.h @@ -37,7 +37,7 @@ #include namespace QmlProfiler { -class QMLPROFILER_EXPORT NotesModel : public QObject { +class QMLPROFILER_EXPORT QmlProfilerNotesModel : public QObject { Q_OBJECT public: struct Note { @@ -49,7 +49,7 @@ public: int timelineIndex; }; - NotesModel(QObject *parent); + QmlProfilerNotesModel(QObject *parent); int count() const; void setModelManager(QmlProfilerModelManager *modelManager); diff --git a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp b/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp similarity index 83% rename from src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp rename to src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp index da9fec71a95..552c17c86a6 100644 --- a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp @@ -28,7 +28,7 @@ ** ****************************************************************************/ -#include "qmlprofilertimelinemodelproxy.h" +#include "qmlprofilerrangemodel.h" #include "qmlprofilermodelmanager.h" #include "qmlprofilerdatamodel.h" #include "abstracttimelinemodel_p.h" @@ -45,7 +45,7 @@ namespace QmlProfiler { namespace Internal { -class RangeTimelineModel::RangeTimelineModelPrivate : public AbstractTimelineModelPrivate +class QmlProfilerRangeModel::QmlProfilerRangeModelPrivate : public AbstractTimelineModelPrivate { public: // convenience functions @@ -56,35 +56,35 @@ public: QVector data; QVector expandedRowTypes; private: - Q_DECLARE_PUBLIC(RangeTimelineModel) + Q_DECLARE_PUBLIC(QmlProfilerRangeModel) }; -RangeTimelineModel::RangeTimelineModel(QmlDebug::RangeType rangeType, QObject *parent) - : AbstractTimelineModel(new RangeTimelineModelPrivate, categoryLabel(rangeType), +QmlProfilerRangeModel::QmlProfilerRangeModel(QmlDebug::RangeType rangeType, QObject *parent) + : AbstractTimelineModel(new QmlProfilerRangeModelPrivate, categoryLabel(rangeType), QmlDebug::MaximumMessage, rangeType, parent) { - Q_D(RangeTimelineModel); + Q_D(QmlProfilerRangeModel); d->expandedRowTypes << -1; } -quint64 RangeTimelineModel::features() const +quint64 QmlProfilerRangeModel::features() const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); return 1ULL << QmlDebug::featureFromRangeType(d->rangeType); } -void RangeTimelineModel::clear() +void QmlProfilerRangeModel::clear() { - Q_D(RangeTimelineModel); + Q_D(QmlProfilerRangeModel); d->expandedRowTypes.clear(); d->expandedRowTypes << -1; d->data.clear(); AbstractTimelineModel::clear(); } -void RangeTimelineModel::loadData() +void QmlProfilerRangeModel::loadData() { - Q_D(RangeTimelineModel); + Q_D(QmlProfilerRangeModel); clear(); QmlProfilerDataModel *simpleModel = d->modelManager->qmlModel(); if (simpleModel->isEmpty()) @@ -126,9 +126,9 @@ void RangeTimelineModel::loadData() d->modelManager->modelProxyCountUpdated(d->modelId, 1, 1); } -void RangeTimelineModel::RangeTimelineModelPrivate::computeNestingContracted() +void QmlProfilerRangeModel::QmlProfilerRangeModelPrivate::computeNestingContracted() { - Q_Q(RangeTimelineModel); + Q_Q(QmlProfilerRangeModel); int i; int eventCount = q->count(); @@ -157,9 +157,9 @@ void RangeTimelineModel::RangeTimelineModelPrivate::computeNestingContracted() } } -void RangeTimelineModel::RangeTimelineModelPrivate::computeExpandedLevels() +void QmlProfilerRangeModel::QmlProfilerRangeModelPrivate::computeExpandedLevels() { - Q_Q(RangeTimelineModel); + Q_Q(QmlProfilerRangeModel); QHash eventRow; int eventCount = q->count(); for (int i = 0; i < eventCount; i++) { @@ -173,9 +173,9 @@ void RangeTimelineModel::RangeTimelineModelPrivate::computeExpandedLevels() expandedRowCount = expandedRowTypes.size(); } -void RangeTimelineModel::RangeTimelineModelPrivate::findBindingLoops() +void QmlProfilerRangeModel::QmlProfilerRangeModelPrivate::findBindingLoops() { - Q_Q(RangeTimelineModel); + Q_Q(QmlProfilerRangeModel); if (rangeType != QmlDebug::Binding && rangeType != QmlDebug::HandlingSignal) return; @@ -210,35 +210,35 @@ void RangeTimelineModel::RangeTimelineModelPrivate::findBindingLoops() /////////////////// QML interface -QString RangeTimelineModel::categoryLabel(QmlDebug::RangeType rangeType) +QString QmlProfilerRangeModel::categoryLabel(QmlDebug::RangeType rangeType) { return QCoreApplication::translate("MainView", QmlProfilerModelManager::featureName(QmlDebug::featureFromRangeType(rangeType))); } -int RangeTimelineModel::row(int index) const +int QmlProfilerRangeModel::row(int index) const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); if (d->expanded) return d->data[index].displayRowExpanded; else return d->data[index].displayRowCollapsed; } -int RangeTimelineModel::bindingLoopDest(int index) const +int QmlProfilerRangeModel::bindingLoopDest(int index) const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); return d->data[index].bindingLoopHead; } -QColor RangeTimelineModel::color(int index) const +QColor QmlProfilerRangeModel::color(int index) const { return colorBySelectionId(index); } -QVariantList RangeTimelineModel::labels() const +QVariantList QmlProfilerRangeModel::labels() const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); QVariantList result; if (d->expanded && !d->hidden) { @@ -257,9 +257,9 @@ QVariantList RangeTimelineModel::labels() const return result; } -QVariantMap RangeTimelineModel::details(int index) const +QVariantMap QmlProfilerRangeModel::details(int index) const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); QVariantMap result; int id = selectionId(index); const QVector &types = @@ -273,9 +273,9 @@ QVariantMap RangeTimelineModel::details(int index) const return result; } -QVariantMap RangeTimelineModel::location(int index) const +QVariantMap QmlProfilerRangeModel::location(int index) const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); QVariantMap result; int id = selectionId(index); @@ -289,9 +289,9 @@ QVariantMap RangeTimelineModel::location(int index) const return result; } -bool RangeTimelineModel::isSelectionIdValid(int typeId) const +bool QmlProfilerRangeModel::isSelectionIdValid(int typeId) const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); if (typeId < 0) return false; const QmlProfilerDataModel::QmlEventTypeData &type = @@ -301,9 +301,9 @@ bool RangeTimelineModel::isSelectionIdValid(int typeId) const return true; } -int RangeTimelineModel::selectionIdForLocation(const QString &filename, int line, int column) const +int QmlProfilerRangeModel::selectionIdForLocation(const QString &filename, int line, int column) const { - Q_D(const RangeTimelineModel); + Q_D(const QmlProfilerRangeModel); // if this is called from v8 view, we don't have the column number, it will be -1 const QVector &types = d->modelManager->qmlModel()->getEventTypes(); diff --git a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h b/src/plugins/qmlprofiler/qmlprofilerrangemodel.h similarity index 89% rename from src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h rename to src/plugins/qmlprofiler/qmlprofilerrangemodel.h index 746208df91c..841a6089f0d 100644 --- a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h +++ b/src/plugins/qmlprofiler/qmlprofilerrangemodel.h @@ -29,8 +29,8 @@ ****************************************************************************/ -#ifndef QMLPROFILERTIMELINEMODELPROXY_H -#define QMLPROFILERTIMELINEMODELPROXY_H +#ifndef QMLPROFILERRANGEMODEL_H +#define QMLPROFILERRANGEMODEL_H #include "abstracttimelinemodel.h" #include @@ -44,7 +44,7 @@ class QmlProfilerModelManager; namespace Internal { -class RangeTimelineModel : public AbstractTimelineModel +class QmlProfilerRangeModel : public AbstractTimelineModel { Q_OBJECT public: @@ -61,7 +61,7 @@ public: int bindingLoopHead; }; - RangeTimelineModel(QmlDebug::RangeType rangeType, QObject *parent = 0); + QmlProfilerRangeModel(QmlDebug::RangeType rangeType, QObject *parent = 0); static QString categoryLabel(QmlDebug::RangeType categoryIndex); quint64 features() const; @@ -82,11 +82,11 @@ protected: void clear(); private: - class RangeTimelineModelPrivate; - Q_DECLARE_PRIVATE(RangeTimelineModel) + class QmlProfilerRangeModelPrivate; + Q_DECLARE_PRIVATE(QmlProfilerRangeModel) }; } } -#endif +#endif // QMLPROFILERRANGEMODEL_H diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 5da9e75a7d4..8758d7b81b1 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -38,7 +38,7 @@ #include "qmlprofilermodelmanager.h" #include "qmlprofilerdetailsrewriter.h" #include "timelinerenderer.h" -#include "notesmodel.h" +#include "qmlprofilernotesmodel.h" #include #include diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp index bc1d4b1ebb3..93f54804a6d 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp @@ -32,7 +32,6 @@ #include "qmlprofilertool.h" #include "qmlprofilerstatemanager.h" #include "qmlprofilermodelmanager.h" -#include "qmlprofilertimelinemodelproxy.h" #include "timelinemodelaggregator.h" // Needed for the load&save actions in the context menu diff --git a/src/plugins/qmlprofiler/timelinemodelaggregator.cpp b/src/plugins/qmlprofiler/timelinemodelaggregator.cpp index b2270d4fef7..8300b327190 100644 --- a/src/plugins/qmlprofiler/timelinemodelaggregator.cpp +++ b/src/plugins/qmlprofiler/timelinemodelaggregator.cpp @@ -30,10 +30,10 @@ #include "timelinemodelaggregator.h" -#include "qmlprofilertimelinemodelproxy.h" -#include "qmlprofilerpainteventsmodelproxy.h" +#include "qmlprofilerrangemodel.h" +#include "qmlprofileranimationsmodel.h" #include "qmlprofilerplugin.h" -#include "notesmodel.h" +#include "qmlprofilernotesmodel.h" #include #include @@ -85,12 +85,12 @@ void TimelineModelAggregator::setModelManager(QmlProfilerModelManager *modelMana addModel(timelineModel); } - PaintEventsModelProxy *paintEventsModelProxy = new PaintEventsModelProxy(this); + QmlProfilerAnimationsModel *paintEventsModelProxy = new QmlProfilerAnimationsModel(this); paintEventsModelProxy->setModelManager(modelManager); addModel(paintEventsModelProxy); for (int i = 0; i < QmlDebug::MaximumRangeType; ++i) { - RangeTimelineModel *rangeModel = new RangeTimelineModel((QmlDebug::RangeType)i, this); + QmlProfilerRangeModel *rangeModel = new QmlProfilerRangeModel((QmlDebug::RangeType)i, this); rangeModel->setModelManager(modelManager); addModel(rangeModel); } @@ -133,7 +133,7 @@ int TimelineModelAggregator::modelIndexFromManagerIndex(int modelManagerIndex) c return d->modelManagerIndexMapping[modelManagerIndex]; } -NotesModel *TimelineModelAggregator::notes() const +QmlProfilerNotesModel *TimelineModelAggregator::notes() const { return d->modelManager->notesModel(); } @@ -334,7 +334,7 @@ void TimelineModelAggregator::setNoteText(int noteId, const QString &text) void TimelineModelAggregator::setNoteText(int modelIndex, int index, const QString &text) { int managerId = d->modelList[modelIndex]->modelId(); - NotesModel *notesModel = notes(); + QmlProfilerNotesModel *notesModel = notes(); int noteId = notesModel->get(managerId, index); if (noteId == -1) { if (text.length() > 0) diff --git a/src/plugins/qmlprofiler/timelinemodelaggregator.h b/src/plugins/qmlprofiler/timelinemodelaggregator.h index 4896ccf2690..7b63ff90da2 100644 --- a/src/plugins/qmlprofiler/timelinemodelaggregator.h +++ b/src/plugins/qmlprofiler/timelinemodelaggregator.h @@ -53,7 +53,7 @@ public: QVariantList models() const; int modelIndexFromManagerIndex(int modelManagerIndex) const; - Q_INVOKABLE NotesModel *notes() const; + Q_INVOKABLE QmlProfilerNotesModel *notes() const; Q_INVOKABLE int count(int modelIndex) const; void clear(); Q_INVOKABLE int modelCount() const; diff --git a/src/plugins/qmlprofiler/timelinerenderer.cpp b/src/plugins/qmlprofiler/timelinerenderer.cpp index 31ffc1afaaa..124eca0351c 100644 --- a/src/plugins/qmlprofiler/timelinerenderer.cpp +++ b/src/plugins/qmlprofiler/timelinerenderer.cpp @@ -29,7 +29,7 @@ ****************************************************************************/ #include "timelinerenderer.h" -#include "notesmodel.h" +#include "qmlprofilernotesmodel.h" #include #include @@ -365,7 +365,7 @@ void TimelineRenderer::drawNotes(QPainter *p) static const int annotationSpace = 4; static const int shadowOffset = 2; - NotesModel *notes = m_profilerModelProxy->notes(); + QmlProfilerNotesModel *notes = m_profilerModelProxy->notes(); for (int i = 0; i < notes->count(); ++i) { int managerIndex = notes->timelineModel(i); if (managerIndex == -1) diff --git a/src/plugins/qmlprofiler/timelinerenderer.h b/src/plugins/qmlprofiler/timelinerenderer.h index d2b56865b83..684a3d69470 100644 --- a/src/plugins/qmlprofiler/timelinerenderer.h +++ b/src/plugins/qmlprofiler/timelinerenderer.h @@ -33,7 +33,6 @@ #include #include -#include "qmlprofilertimelinemodelproxy.h" #include "timelinezoomcontrol.h" #include "timelinemodelaggregator.h"