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 <kai.koehne@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2014-10-27 17:41:22 +01:00
committed by Ulf Hermann
parent 70102410df
commit a42e07beba
19 changed files with 178 additions and 180 deletions

View File

@@ -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 += \

View File

@@ -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",

View File

@@ -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());

View File

@@ -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

View File

@@ -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>

View File

@@ -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) {

View File

@@ -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>

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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);
int count() const;
void setModelManager(QmlProfilerModelManager *modelManager);

View File

@@ -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<QmlRangeEventStartInstance> data;
QVector<int> 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<int, int> 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<QmlProfilerDataModel::QmlEventTypeData> &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<QmlProfilerDataModel::QmlEventTypeData> &types =
d->modelManager->qmlModel()->getEventTypes();

View File

@@ -29,8 +29,8 @@
****************************************************************************/
#ifndef QMLPROFILERTIMELINEMODELPROXY_H
#define QMLPROFILERTIMELINEMODELPROXY_H
#ifndef QMLPROFILERRANGEMODEL_H
#define QMLPROFILERRANGEMODEL_H
#include "abstracttimelinemodel.h"
#include <qmldebug/qmlprofilereventtypes.h>
@@ -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

View File

@@ -38,7 +38,7 @@
#include "qmlprofilermodelmanager.h"
#include "qmlprofilerdetailsrewriter.h"
#include "timelinerenderer.h"
#include "notesmodel.h"
#include "qmlprofilernotesmodel.h"
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerruncontrol.h>

View File

@@ -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

View File

@@ -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 <QStringList>
#include <QVariant>
@@ -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)

View File

@@ -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;

View File

@@ -29,7 +29,7 @@
****************************************************************************/
#include "timelinerenderer.h"
#include "notesmodel.h"
#include "qmlprofilernotesmodel.h"
#include <QQmlContext>
#include <QQmlProperty>
@@ -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)

View File

@@ -33,7 +33,6 @@
#include <QQuickPaintedItem>
#include <QJSValue>
#include "qmlprofilertimelinemodelproxy.h"
#include "timelinezoomcontrol.h"
#include "timelinemodelaggregator.h"