Commit a42e07be authored by Ulf Hermann's avatar Ulf Hermann Committed by Ulf Hermann
Browse files

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: default avatarKai Koehne <kai.koehne@theqtcompany.com>
parent 70102410
......@@ -5,70 +5,70 @@ QT += network qml quick
include(../../qtcreatorplugin.pri)
SOURCES += \
qmlprofilerplugin.cpp \
qmlprofilertool.cpp \
qmlprofilerengine.cpp \
qmlprofilerattachdialog.cpp \
abstracttimelinemodel.cpp \
localqmlprofilerrunner.cpp \
qmlprofilereventview.cpp \
qv8profilereventview.cpp \
qmlprofileranimationsmodel.cpp \
qmlprofilerattachdialog.cpp \
qmlprofilerbasemodel.cpp \
qmlprofilerclientmanager.cpp \
qmlprofilerdatamodel.cpp \
qmlprofilerdetailsrewriter.cpp \
qmlprofilertraceview.cpp \
timelinerenderer.cpp \
qmlprofilerengine.cpp \
qmlprofilereventsmodelproxy.cpp \
qmlprofilereventview.cpp \
qmlprofilermodelmanager.cpp \
qmlprofilernotesmodel.cpp \
qmlprofilerplugin.cpp \
qmlprofilerrangemodel.cpp \
qmlprofilerruncontrolfactory.cpp \
qmlprofilerstatemanager.cpp \
qv8profilerdatamodel.cpp \
qmlprofilerclientmanager.cpp \
qmlprofilerviewmanager.cpp \
qmlprofilerstatewidget.cpp \
qmlprofilerruncontrolfactory.cpp \
qmlprofilermodelmanager.cpp \
qmlprofilereventsmodelproxy.cpp \
qmlprofilertimelinemodelproxy.cpp \
qmlprofilertreeview.cpp \
qmlprofilertool.cpp \
qmlprofilertracefile.cpp \
abstracttimelinemodel.cpp \
timelinemodelaggregator.cpp \
qmlprofilerpainteventsmodelproxy.cpp \
qmlprofilertraceview.cpp \
qmlprofilertreeview.cpp \
qmlprofilerviewmanager.cpp \
qv8profilerdatamodel.cpp \
qv8profilereventview.cpp \
sortedtimelinemodel.cpp \
qmlprofilerbasemodel.cpp \
qmlprofilerdatamodel.cpp \
notesmodel.cpp \
timelinemodelaggregator.cpp \
timelinerenderer.cpp \
timelinezoomcontrol.cpp
HEADERS += \
qmlprofilerconstants.h \
qmlprofiler_global.h \
qmlprofilerplugin.h \
qmlprofilertool.h \
qmlprofilerengine.h \
qmlprofilerattachdialog.h \
abstractqmlprofilerrunner.h \
abstracttimelinemodel.h \
abstracttimelinemodel_p.h \
localqmlprofilerrunner.h \
qmlprofilereventview.h \
qv8profilereventview.h \
qmlprofiler_global.h \
qmlprofileranimationsmodel.h \
qmlprofilerattachdialog.h \
qmlprofilerbasemodel.h \
qmlprofilerbasemodel_p.h \
qmlprofilerclientmanager.h \
qmlprofilerconstants.h \
qmlprofilerdatamodel.h \
qmlprofilerdetailsrewriter.h \
qmlprofilertraceview.h \
timelinerenderer.h \
qmlprofilerengine.h \
qmlprofilereventsmodelproxy.h \
qmlprofilereventview.h \
qmlprofilermodelmanager.h \
qmlprofilernotesmodel.h \
qmlprofilerplugin.h \
qmlprofilerrangemodel.h \
qmlprofilerruncontrolfactory.h \
qmlprofilerstatemanager.h \
qv8profilerdatamodel.h \
qmlprofilerclientmanager.h \
qmlprofilerviewmanager.h \
qmlprofilerstatewidget.h \
qmlprofilerruncontrolfactory.h \
qmlprofilermodelmanager.h \
qmlprofilereventsmodelproxy.h \
qmlprofilertimelinemodelproxy.h \
qmlprofilertreeview.h \
qmlprofilertool.h \
qmlprofilertracefile.h \
abstracttimelinemodel.h \
timelinemodelaggregator.h \
qmlprofilerpainteventsmodelproxy.h \
qmlprofilertraceview.h \
qmlprofilertreeview.h \
qmlprofilerviewmanager.h \
qv8profilerdatamodel.h \
qv8profilereventview.h \
sortedtimelinemodel.h \
qmlprofilerbasemodel.h \
abstracttimelinemodel_p.h \
qmlprofilerdatamodel.h \
qmlprofilerbasemodel_p.h \
notesmodel.h \
timelinemodelaggregator.h \
timelinerenderer.h \
timelinezoomcontrol.h
RESOURCES += \
......
......@@ -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",
......
......@@ -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<PaintEventsModelProxy::QmlPaintEventData> data;
QVector<QmlProfilerAnimationsModel::QmlPaintEventData> 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());
......
......@@ -29,8 +29,8 @@
****************************************************************************/
#ifndef QMLPROFILERPAINTEVENTSMODELPROXY_H
#define QMLPROFILERPAINTEVENTSMODELPROXY_H
#ifndef QMLPROFILERANIMATIONSMODEL_H
#define QMLPROFILERANIMATIONSMODEL_H
#include <QObject>
#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
......@@ -31,7 +31,7 @@
#include "qmlprofilerdatamodel.h"
#include "qmlprofilerbasemodel_p.h"
#include "qmlprofilermodelmanager.h"
#include "notesmodel.h"
#include "qmlprofilernotesmodel.h"
#include <qmldebug/qmlprofilereventtypes.h>
#include <utils/qtcassert.h>
#include <QUrl>
......
......@@ -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) {
......
......@@ -33,7 +33,7 @@
#define QMLPROFILEREVENTSMODELPROXY_H
#include "qmlprofilerdatamodel.h"
#include "notesmodel.h"
#include "qmlprofilernotesmodel.h"
#include <QObject>
#include <qmldebug/qmlprofilereventtypes.h>
#include <qmldebug/qmlprofilereventlocation.h>
......
......@@ -32,7 +32,7 @@
#include "qmlprofilerdatamodel.h"
#include "qv8profilerdatamodel.h"
#include "qmlprofilertracefile.h"
#include "notesmodel.h"
#include "qmlprofilernotesmodel.h"
#include <utils/qtcassert.h>
......@@ -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;
}
......
......@@ -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;
......
......@@ -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 &note = 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 &note = 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 &note = 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 &note = 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<QmlProfilerDataModel::QmlEventNoteData> &notes =
......@@ -208,7 +209,7 @@ void NotesModel::loadData()
emit changed(-1, -1, -1);
}
void NotesModel::saveData()
void QmlProfilerNotesModel::saveData()
{
QVector<QmlProfilerDataModel::QmlEventNoteData> notes;
for (int i = 0; i < count(); ++i) {
......
......@@ -37,7 +37,7 @@
#include <QHash>
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);