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) include(../../qtcreatorplugin.pri)
SOURCES += \ 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 \ abstracttimelinemodel.cpp \
timelinemodelaggregator.cpp \ localqmlprofilerrunner.cpp \
qmlprofilerpainteventsmodelproxy.cpp \ qmlprofileranimationsmodel.cpp \
sortedtimelinemodel.cpp \ qmlprofilerattachdialog.cpp \
qmlprofilerbasemodel.cpp \ qmlprofilerbasemodel.cpp \
qmlprofilerclientmanager.cpp \
qmlprofilerdatamodel.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 timelinezoomcontrol.cpp
HEADERS += \ HEADERS += \
qmlprofilerconstants.h \
qmlprofiler_global.h \
qmlprofilerplugin.h \
qmlprofilertool.h \
qmlprofilerengine.h \
qmlprofilerattachdialog.h \
abstractqmlprofilerrunner.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 \ abstracttimelinemodel.h \
timelinemodelaggregator.h \
qmlprofilerpainteventsmodelproxy.h \
sortedtimelinemodel.h \
qmlprofilerbasemodel.h \
abstracttimelinemodel_p.h \ abstracttimelinemodel_p.h \
qmlprofilerdatamodel.h \ localqmlprofilerrunner.h \
qmlprofiler_global.h \
qmlprofileranimationsmodel.h \
qmlprofilerattachdialog.h \
qmlprofilerbasemodel.h \
qmlprofilerbasemodel_p.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 timelinezoomcontrol.h
RESOURCES += \ RESOURCES += \

View File

@@ -23,9 +23,8 @@ QtcPlugin {
"abstractqmlprofilerrunner.h", "abstractqmlprofilerrunner.h",
"abstracttimelinemodel.h", "abstracttimelinemodel_p.h", "abstracttimelinemodel.cpp", "abstracttimelinemodel.h", "abstracttimelinemodel_p.h", "abstracttimelinemodel.cpp",
"localqmlprofilerrunner.cpp", "localqmlprofilerrunner.h", "localqmlprofilerrunner.cpp", "localqmlprofilerrunner.h",
"notesmodel.cpp",
"notesmodel.h",
"qmlprofiler_global.h", "qmlprofiler_global.h",
"qmlprofileranimationsmodel.h", "qmlprofileranimationsmodel.cpp",
"qmlprofilerattachdialog.cpp", "qmlprofilerattachdialog.h", "qmlprofilerattachdialog.cpp", "qmlprofilerattachdialog.h",
"qmlprofilerbasemodel.cpp", "qmlprofilerbasemodel.h", "qmlprofilerbasemodel_p.h", "qmlprofilerbasemodel.cpp", "qmlprofilerbasemodel.h", "qmlprofilerbasemodel_p.h",
"qmlprofilerclientmanager.cpp", "qmlprofilerclientmanager.h", "qmlprofilerclientmanager.cpp", "qmlprofilerclientmanager.h",
@@ -36,12 +35,12 @@ QtcPlugin {
"qmlprofilereventsmodelproxy.cpp", "qmlprofilereventsmodelproxy.h", "qmlprofilereventsmodelproxy.cpp", "qmlprofilereventsmodelproxy.h",
"qmlprofilereventview.cpp", "qmlprofilereventview.h", "qmlprofilereventview.cpp", "qmlprofilereventview.h",
"qmlprofilermodelmanager.cpp", "qmlprofilermodelmanager.h", "qmlprofilermodelmanager.cpp", "qmlprofilermodelmanager.h",
"qmlprofilerpainteventsmodelproxy.h", "qmlprofilerpainteventsmodelproxy.cpp", "qmlprofilernotesmodel.cpp", "qmlprofilernotesmodel.h",
"qmlprofilerplugin.cpp", "qmlprofilerplugin.h", "qmlprofilerplugin.cpp", "qmlprofilerplugin.h",
"qmlprofilerruncontrolfactory.cpp", "qmlprofilerruncontrolfactory.h", "qmlprofilerruncontrolfactory.cpp", "qmlprofilerruncontrolfactory.h",
"qmlprofilerstatemanager.cpp", "qmlprofilerstatemanager.h", "qmlprofilerstatemanager.cpp", "qmlprofilerstatemanager.h",
"qmlprofilerstatewidget.cpp", "qmlprofilerstatewidget.h", "qmlprofilerstatewidget.cpp", "qmlprofilerstatewidget.h",
"qmlprofilertimelinemodelproxy.cpp", "qmlprofilertimelinemodelproxy.h", "qmlprofilerrangemodel.cpp", "qmlprofilerrangemodel.h",
"qmlprofilertool.cpp", "qmlprofilertool.h", "qmlprofilertool.cpp", "qmlprofilertool.h",
"qmlprofilertracefile.cpp", "qmlprofilertracefile.h", "qmlprofilertracefile.cpp", "qmlprofilertracefile.h",
"qmlprofilertraceview.cpp", "qmlprofilertraceview.h", "qmlprofilertraceview.cpp", "qmlprofilertraceview.h",

View File

@@ -28,7 +28,7 @@
** **
****************************************************************************/ ****************************************************************************/
#include "qmlprofilerpainteventsmodelproxy.h" #include "qmlprofileranimationsmodel.h"
#include "qmlprofilermodelmanager.h" #include "qmlprofilermodelmanager.h"
#include "qmlprofilerdatamodel.h" #include "qmlprofilerdatamodel.h"
#include "abstracttimelinemodel_p.h" #include "abstracttimelinemodel_p.h"
@@ -46,49 +46,49 @@
namespace QmlProfiler { namespace QmlProfiler {
namespace Internal { namespace Internal {
class PaintEventsModelProxy::PaintEventsModelProxyPrivate : public AbstractTimelineModelPrivate class QmlProfilerAnimationsModel::QmlProfilerAnimationsModelPrivate : public AbstractTimelineModelPrivate
{ {
public: public:
QVector<PaintEventsModelProxy::QmlPaintEventData> data; QVector<QmlProfilerAnimationsModel::QmlPaintEventData> data;
int maxGuiThreadAnimations; int maxGuiThreadAnimations;
int maxRenderThreadAnimations; int maxRenderThreadAnimations;
int rowFromThreadId(QmlDebug::AnimationThread threadId) const; int rowFromThreadId(QmlDebug::AnimationThread threadId) const;
private: private:
Q_DECLARE_PUBLIC(PaintEventsModelProxy) Q_DECLARE_PUBLIC(QmlProfilerAnimationsModel)
}; };
PaintEventsModelProxy::PaintEventsModelProxy(QObject *parent) QmlProfilerAnimationsModel::QmlProfilerAnimationsModel(QObject *parent)
: AbstractTimelineModel(new PaintEventsModelProxyPrivate, : AbstractTimelineModel(new QmlProfilerAnimationsModelPrivate,
tr(QmlProfilerModelManager::featureName(QmlDebug::ProfileAnimations)), tr(QmlProfilerModelManager::featureName(QmlDebug::ProfileAnimations)),
QmlDebug::Event, QmlDebug::MaximumRangeType, parent) QmlDebug::Event, QmlDebug::MaximumRangeType, parent)
{ {
Q_D(PaintEventsModelProxy); Q_D(QmlProfilerAnimationsModel);
d->maxGuiThreadAnimations = d->maxRenderThreadAnimations = 0; d->maxGuiThreadAnimations = d->maxRenderThreadAnimations = 0;
} }
quint64 PaintEventsModelProxy::features() const quint64 QmlProfilerAnimationsModel::features() const
{ {
return 1 << QmlDebug::ProfileAnimations; return 1 << QmlDebug::ProfileAnimations;
} }
void PaintEventsModelProxy::clear() void QmlProfilerAnimationsModel::clear()
{ {
Q_D(PaintEventsModelProxy); Q_D(QmlProfilerAnimationsModel);
d->maxGuiThreadAnimations = d->maxRenderThreadAnimations = 0; d->maxGuiThreadAnimations = d->maxRenderThreadAnimations = 0;
d->data.clear(); d->data.clear();
AbstractTimelineModel::clear(); AbstractTimelineModel::clear();
} }
bool PaintEventsModelProxy::accepted(const QmlProfilerDataModel::QmlEventTypeData &event) const bool QmlProfilerAnimationsModel::accepted(const QmlProfilerDataModel::QmlEventTypeData &event) const
{ {
return AbstractTimelineModel::accepted(event) && return AbstractTimelineModel::accepted(event) &&
event.detailType== QmlDebug::AnimationFrame; event.detailType== QmlDebug::AnimationFrame;
} }
void PaintEventsModelProxy::loadData() void QmlProfilerAnimationsModel::loadData()
{ {
Q_D(PaintEventsModelProxy); Q_D(QmlProfilerAnimationsModel);
clear(); clear();
QmlProfilerDataModel *simpleModel = d->modelManager->qmlModel(); QmlProfilerDataModel *simpleModel = d->modelManager->qmlModel();
if (simpleModel->isEmpty()) if (simpleModel->isEmpty())
@@ -149,21 +149,21 @@ void PaintEventsModelProxy::loadData()
/////////////////// QML interface /////////////////// QML interface
int PaintEventsModelProxy::PaintEventsModelProxyPrivate::rowFromThreadId( int QmlProfilerAnimationsModel::QmlProfilerAnimationsModelPrivate::rowFromThreadId(
QmlDebug::AnimationThread threadId) const QmlDebug::AnimationThread threadId) const
{ {
return (threadId == QmlDebug::GuiThread || maxGuiThreadAnimations == 0) ? 1 : 2; 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); 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) { switch (rowNumber) {
case 1: case 1:
return d->maxGuiThreadAnimations > 0 ? d->maxGuiThreadAnimations : 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; 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; double fpsFraction = d->data[index].framerate / 60.0;
if (fpsFraction > 1.0) if (fpsFraction > 1.0)
fpsFraction = 1.0; fpsFraction = 1.0;
@@ -192,9 +192,9 @@ QColor PaintEventsModelProxy::color(int index) const
return colorByFraction(fpsFraction); 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]; const QmlPaintEventData &data = d->data[index];
// Add some height to the events if we're far from the scale threshold of 2 * DefaultRowHeight. // 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); d->maxRenderThreadAnimations);
} }
QVariantList PaintEventsModelProxy::labels() const QVariantList QmlProfilerAnimationsModel::labels() const
{ {
Q_D(const PaintEventsModelProxy); Q_D(const QmlProfilerAnimationsModel);
QVariantList result; QVariantList result;
if (!d->hidden && d->maxGuiThreadAnimations > 0) { if (!d->hidden && d->maxGuiThreadAnimations > 0) {
@@ -231,9 +231,9 @@ QVariantList PaintEventsModelProxy::labels() const
return result; return result;
} }
QVariantMap PaintEventsModelProxy::details(int index) const QVariantMap QmlProfilerAnimationsModel::details(int index) const
{ {
Q_D(const PaintEventsModelProxy); Q_D(const QmlProfilerAnimationsModel);
QVariantMap result; QVariantMap result;
result.insert(QStringLiteral("displayName"), displayName()); result.insert(QStringLiteral("displayName"), displayName());

View File

@@ -29,8 +29,8 @@
****************************************************************************/ ****************************************************************************/
#ifndef QMLPROFILERPAINTEVENTSMODELPROXY_H #ifndef QMLPROFILERANIMATIONSMODEL_H
#define QMLPROFILERPAINTEVENTSMODELPROXY_H #define QMLPROFILERANIMATIONSMODEL_H
#include <QObject> #include <QObject>
#include "abstracttimelinemodel.h" #include "abstracttimelinemodel.h"
@@ -49,7 +49,7 @@ class QmlProfilerModelManager;
namespace Internal { namespace Internal {
class PaintEventsModelProxy : public AbstractTimelineModel class QmlProfilerAnimationsModel : public AbstractTimelineModel
{ {
Q_OBJECT Q_OBJECT
public: public:
@@ -60,7 +60,7 @@ public:
QmlDebug::AnimationThread threadId; QmlDebug::AnimationThread threadId;
}; };
PaintEventsModelProxy(QObject *parent = 0); QmlProfilerAnimationsModel(QObject *parent = 0);
int rowMaxValue(int rowNumber) const; int rowMaxValue(int rowNumber) const;
@@ -81,11 +81,11 @@ protected:
void clear(); void clear();
private: private:
class PaintEventsModelProxyPrivate; class QmlProfilerAnimationsModelPrivate;
Q_DECLARE_PRIVATE(PaintEventsModelProxy) Q_DECLARE_PRIVATE(QmlProfilerAnimationsModel)
}; };
} }
} }
#endif #endif // QMLPROFILERANIMATIONSMODEL_H

View File

@@ -31,7 +31,7 @@
#include "qmlprofilerdatamodel.h" #include "qmlprofilerdatamodel.h"
#include "qmlprofilerbasemodel_p.h" #include "qmlprofilerbasemodel_p.h"
#include "qmlprofilermodelmanager.h" #include "qmlprofilermodelmanager.h"
#include "notesmodel.h" #include "qmlprofilernotesmodel.h"
#include <qmldebug/qmlprofilereventtypes.h> #include <qmldebug/qmlprofilereventtypes.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QUrl> #include <QUrl>

View File

@@ -138,7 +138,7 @@ void QmlProfilerEventsModelProxy::dataChanged()
void QmlProfilerEventsModelProxy::notesChanged(int typeIndex) void QmlProfilerEventsModelProxy::notesChanged(int typeIndex)
{ {
const NotesModel *notesModel = d->modelManager->notesModel(); const QmlProfilerNotesModel *notesModel = d->modelManager->notesModel();
if (typeIndex == -1) { if (typeIndex == -1) {
d->notes.clear(); d->notes.clear();
for (int noteId = 0; noteId < notesModel->count(); ++noteId) { for (int noteId = 0; noteId < notesModel->count(); ++noteId) {

View File

@@ -33,7 +33,7 @@
#define QMLPROFILEREVENTSMODELPROXY_H #define QMLPROFILEREVENTSMODELPROXY_H
#include "qmlprofilerdatamodel.h" #include "qmlprofilerdatamodel.h"
#include "notesmodel.h" #include "qmlprofilernotesmodel.h"
#include <QObject> #include <QObject>
#include <qmldebug/qmlprofilereventtypes.h> #include <qmldebug/qmlprofilereventtypes.h>
#include <qmldebug/qmlprofilereventlocation.h> #include <qmldebug/qmlprofilereventlocation.h>

View File

@@ -32,7 +32,7 @@
#include "qmlprofilerdatamodel.h" #include "qmlprofilerdatamodel.h"
#include "qv8profilerdatamodel.h" #include "qv8profilerdatamodel.h"
#include "qmlprofilertracefile.h" #include "qmlprofilertracefile.h"
#include "notesmodel.h" #include "qmlprofilernotesmodel.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -171,7 +171,7 @@ public:
QmlProfilerDataModel *model; QmlProfilerDataModel *model;
QV8ProfilerDataModel *v8Model; QV8ProfilerDataModel *v8Model;
NotesModel *notesModel; QmlProfilerNotesModel *notesModel;
QmlProfilerDataState *dataState; QmlProfilerDataState *dataState;
QmlProfilerTraceTime *traceTime; QmlProfilerTraceTime *traceTime;
@@ -198,7 +198,7 @@ QmlProfilerModelManager::QmlProfilerModelManager(Utils::FileInProjectFinder *fin
d->v8Model = new QV8ProfilerDataModel(finder, this); d->v8Model = new QV8ProfilerDataModel(finder, this);
d->dataState = new QmlProfilerDataState(this, this); d->dataState = new QmlProfilerDataState(this, this);
d->traceTime = new QmlProfilerTraceTime(this); d->traceTime = new QmlProfilerTraceTime(this);
d->notesModel = new NotesModel(this); d->notesModel = new QmlProfilerNotesModel(this);
d->notesModel->setModelManager(this); d->notesModel->setModelManager(this);
} }
@@ -222,7 +222,7 @@ QV8ProfilerDataModel *QmlProfilerModelManager::v8Model() const
return d->v8Model; return d->v8Model;
} }
NotesModel *QmlProfilerModelManager::notesModel() const QmlProfilerNotesModel *QmlProfilerModelManager::notesModel() const
{ {
return d->notesModel; return d->notesModel;
} }

View File

@@ -43,7 +43,7 @@ namespace QmlProfiler {
class QmlProfilerModelManager; class QmlProfilerModelManager;
class QmlProfilerDataModel; class QmlProfilerDataModel;
class QV8ProfilerDataModel; class QV8ProfilerDataModel;
class NotesModel; class QmlProfilerNotesModel;
namespace Internal { namespace Internal {
@@ -119,7 +119,7 @@ public:
QmlProfilerTraceTime *traceTime() const; QmlProfilerTraceTime *traceTime() const;
QmlProfilerDataModel *qmlModel() const; QmlProfilerDataModel *qmlModel() const;
QV8ProfilerDataModel *v8Model() const; QV8ProfilerDataModel *v8Model() const;
NotesModel *notesModel() const; QmlProfilerNotesModel *notesModel() const;
bool isEmpty() const; bool isEmpty() const;
int count() const; int count() const;

View File

@@ -28,32 +28,33 @@
** **
****************************************************************************/ ****************************************************************************/
#include "notesmodel.h" #include "qmlprofilernotesmodel.h"
namespace QmlProfiler { 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(); return m_data.count();
} }
void NotesModel::setModelManager(QmlProfilerModelManager *modelManager) void QmlProfilerNotesModel::setModelManager(QmlProfilerModelManager *modelManager)
{ {
m_modelManager = modelManager; m_modelManager = modelManager;
} }
void NotesModel::addTimelineModel(const AbstractTimelineModel *timelineModel) void QmlProfilerNotesModel::addTimelineModel(const AbstractTimelineModel *timelineModel)
{ {
connect(timelineModel, &AbstractTimelineModel::destroyed, connect(timelineModel, &AbstractTimelineModel::destroyed,
this, &NotesModel::removeTimelineModel); this, &QmlProfilerNotesModel::removeTimelineModel);
m_timelineModels.insert(timelineModel->modelId(), timelineModel); m_timelineModels.insert(timelineModel->modelId(), timelineModel);
} }
int NotesModel::typeId(int index) const int QmlProfilerNotesModel::typeId(int index) const
{ {
const Note &note = m_data[index]; const Note &note = m_data[index];
auto it = m_timelineModels.find(note.timelineModel); auto it = m_timelineModels.find(note.timelineModel);
@@ -62,22 +63,22 @@ int NotesModel::typeId(int index) const
return it.value()->typeId(note.timelineIndex); return it.value()->typeId(note.timelineIndex);
} }
QString NotesModel::text(int index) const QString QmlProfilerNotesModel::text(int index) const
{ {
return m_data[index].text; return m_data[index].text;
} }
int NotesModel::timelineModel(int index) const int QmlProfilerNotesModel::timelineModel(int index) const
{ {
return m_data[index].timelineModel; return m_data[index].timelineModel;
} }
int NotesModel::timelineIndex(int index) const int QmlProfilerNotesModel::timelineIndex(int index) const
{ {
return m_data[index].timelineIndex; return m_data[index].timelineIndex;
} }
QVariantList NotesModel::byTypeId(int selectedType) const QVariantList QmlProfilerNotesModel::byTypeId(int selectedType) const
{ {
QVariantList ret; QVariantList ret;
for (int noteId = 0; noteId < count(); ++noteId) { for (int noteId = 0; noteId < count(); ++noteId) {
@@ -87,7 +88,7 @@ QVariantList NotesModel::byTypeId(int selectedType) const
return ret; return ret;
} }
QVariantList NotesModel::byTimelineModel(int timelineModel) const QVariantList QmlProfilerNotesModel::byTimelineModel(int timelineModel) const
{ {
QVariantList ret; QVariantList ret;
for (int noteId = 0; noteId < count(); ++noteId) { for (int noteId = 0; noteId < count(); ++noteId) {
@@ -97,7 +98,7 @@ QVariantList NotesModel::byTimelineModel(int timelineModel) const
return ret; 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) { for (int noteId = 0; noteId < count(); ++noteId) {
const Note &note = m_data[noteId]; const Note &note = m_data[noteId];
@@ -108,7 +109,7 @@ int NotesModel::get(int timelineModel, int timelineIndex) const
return -1; 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]; const AbstractTimelineModel *model = m_timelineModels[timelineModel];
int typeId = model->range(timelineIndex).typeId; 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; 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]; Note &note = m_data[index];
if (text != note.text) { 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]; Note &note = m_data[index];
int noteType = typeId(index); int noteType = typeId(index);
@@ -140,12 +141,12 @@ void NotesModel::remove(int index)
emit changed(noteType, timelineModel, timelineIndex); emit changed(noteType, timelineModel, timelineIndex);
} }
bool NotesModel::isModified() const bool QmlProfilerNotesModel::isModified() const
{ {
return m_modified; return m_modified;
} }
void NotesModel::removeTimelineModel(QObject *timelineModel) void QmlProfilerNotesModel::removeTimelineModel(QObject *timelineModel)
{ {
for (auto i = m_timelineModels.begin(); i != m_timelineModels.end();) { for (auto i = m_timelineModels.begin(); i != m_timelineModels.end();) {
if (i.value() == timelineModel) 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 timelineModel = -1;
int timelineIndex = -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; return m_data.count() - 1;
} }
void NotesModel::clear() void QmlProfilerNotesModel::clear()
{ {
m_data.clear(); m_data.clear();
m_modified = false; m_modified = false;
emit changed(-1, -1, -1); emit changed(-1, -1, -1);
} }
void NotesModel::loadData() void QmlProfilerNotesModel::loadData()
{ {
m_data.clear(); m_data.clear();
const QVector<QmlProfilerDataModel::QmlEventNoteData> &notes = const QVector<QmlProfilerDataModel::QmlEventNoteData> &notes =
@@ -208,7 +209,7 @@ void NotesModel::loadData()
emit changed(-1, -1, -1); emit changed(-1, -1, -1);
} }
void NotesModel::saveData() void QmlProfilerNotesModel::saveData()
{ {
QVector<QmlProfilerDataModel::QmlEventNoteData> notes; QVector<QmlProfilerDataModel::QmlEventNoteData> notes;
for (int i = 0; i < count(); ++i) { for (int i = 0; i < count(); ++i) {

View File

@@ -37,7 +37,7 @@
#include <QHash> #include <QHash>
namespace QmlProfiler { namespace QmlProfiler {
class QMLPROFILER_EXPORT NotesModel : public QObject { class QMLPROFILER_EXPORT QmlProfilerNotesModel : public QObject {
Q_OBJECT Q_OBJECT
public: public:
struct Note { struct Note {
@@ -49,7 +49,7 @@ public:
int timelineIndex; int timelineIndex;
}; };
NotesModel(QObject *parent); QmlProfilerNotesModel(QObject *parent);
int count() const; int count() const;
void setModelManager(QmlProfilerModelManager *modelManager); void setModelManager(QmlProfilerModelManager *modelManager);

View File

@@ -28,7 +28,7 @@
** **
****************************************************************************/ ****************************************************************************/
#include "qmlprofilertimelinemodelproxy.h" #include "qmlprofilerrangemodel.h"
#include "qmlprofilermodelmanager.h" #include "qmlprofilermodelmanager.h"
#include "qmlprofilerdatamodel.h" #include "qmlprofilerdatamodel.h"
#include "abstracttimelinemodel_p.h" #include "abstracttimelinemodel_p.h"
@@ -45,7 +45,7 @@
namespace QmlProfiler { namespace QmlProfiler {
namespace Internal { namespace Internal {
class RangeTimelineModel::RangeTimelineModelPrivate : public AbstractTimelineModelPrivate class QmlProfilerRangeModel::QmlProfilerRangeModelPrivate : public AbstractTimelineModelPrivate
{ {
public: public:
// convenience functions // convenience functions
@@ -56,35 +56,35 @@ public:
QVector<QmlRangeEventStartInstance> data; QVector<QmlRangeEventStartInstance> data;
QVector<int> expandedRowTypes; QVector<int> expandedRowTypes;
private: private:
Q_DECLARE_PUBLIC(RangeTimelineModel) Q_DECLARE_PUBLIC(QmlProfilerRangeModel)
}; };
RangeTimelineModel::RangeTimelineModel(QmlDebug::RangeType rangeType, QObject *parent) QmlProfilerRangeModel::QmlProfilerRangeModel(QmlDebug::RangeType rangeType, QObject *parent)
: AbstractTimelineModel(new RangeTimelineModelPrivate, categoryLabel(rangeType), : AbstractTimelineModel(new QmlProfilerRangeModelPrivate, categoryLabel(rangeType),
QmlDebug::MaximumMessage, rangeType, parent) QmlDebug::MaximumMessage, rangeType, parent)
{ {
Q_D(RangeTimelineModel); Q_D(QmlProfilerRangeModel);
d->expandedRowTypes << -1; 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); return 1ULL << QmlDebug::featureFromRangeType(d->rangeType);
} }
void RangeTimelineModel::clear() void QmlProfilerRangeModel::clear()
{ {
Q_D(RangeTimelineModel); Q_D(QmlProfilerRangeModel);
d->expandedRowTypes.clear(); d->expandedRowTypes.clear();
d->expandedRowTypes << -1; d->expandedRowTypes << -1;
d->data.clear(); d->data.clear();
AbstractTimelineModel::clear(); AbstractTimelineModel::clear();
} }
void RangeTimelineModel::loadData() void QmlProfilerRangeModel::loadData()
{ {
Q_D(RangeTimelineModel); Q_D(QmlProfilerRangeModel);
clear(); clear();
QmlProfilerDataModel *simpleModel = d->modelManager->qmlModel(); QmlProfilerDataModel *simpleModel = d->modelManager->qmlModel();
if (simpleModel->isEmpty()) if (simpleModel->isEmpty())
@@ -126,9 +126,9 @@ void RangeTimelineModel::loadData()
d->modelManager->modelProxyCountUpdated(d->modelId, 1, 1); d->modelManager->modelProxyCountUpdated(d->modelId, 1, 1);
} }
void RangeTimelineModel::RangeTimelineModelPrivate::computeNestingContracted() void QmlProfilerRangeModel::QmlProfilerRangeModelPrivate::computeNestingContracted()
{ {
Q_Q(RangeTimelineModel); Q_Q(QmlProfilerRangeModel);
int i; int i;
int eventCount = q->count(); 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; QHash<int, int> eventRow;
int eventCount = q->count(); int eventCount = q->count();
for (int i = 0; i < eventCount; i++) { for (int i = 0; i < eventCount; i++) {
@@ -173,9 +173,9 @@ void RangeTimelineModel::RangeTimelineModelPrivate::computeExpandedLevels()
expandedRowCount = expandedRowTypes.size(); expandedRowCount = expandedRowTypes.size();
} }
void RangeTimelineModel::RangeTimelineModelPrivate::findBindingLoops() void QmlProfilerRangeModel::QmlProfilerRangeModelPrivate::findBindingLoops()
{ {
Q_Q(RangeTimelineModel); Q_Q(QmlProfilerRangeModel);
if (rangeType != QmlDebug::Binding && rangeType != QmlDebug::HandlingSignal) if (rangeType != QmlDebug::Binding && rangeType != QmlDebug::HandlingSignal)
return; return;
@@ -210,35 +210,35 @@ void RangeTimelineModel::RangeTimelineModelPrivate::findBindingLoops()
/////////////////// QML interface /////////////////// QML interface
QString RangeTimelineModel::categoryLabel(QmlDebug::RangeType rangeType) QString QmlProfilerRangeModel::categoryLabel(QmlDebug::RangeType rangeType)
{ {
return QCoreApplication::translate("MainView", return QCoreApplication::translate("MainView",
QmlProfilerModelManager::featureName(QmlDebug::featureFromRangeType(rangeType))); 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) if (d->expanded)
return d->data[index].displayRowExpanded; return d->data[index].displayRowExpanded;
else else
return d->data[index].displayRowCollapsed; 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; return d->data[index].bindingLoopHead;
} }
QColor RangeTimelineModel::color(int index) const QColor QmlProfilerRangeModel::color(int index) const
{ {
return colorBySelectionId(index); return colorBySelectionId(index);
} }
QVariantList RangeTimelineModel::labels() const QVariantList QmlProfilerRangeModel::labels() const
{ {
Q_D(const RangeTimelineModel); Q_D(const QmlProfilerRangeModel);
QVariantList result; QVariantList result;
if (d->expanded && !d->hidden) { if (d->expanded && !d->hidden) {
@@ -257,9 +257,9 @@ QVariantList RangeTimelineModel::labels() const
return result; return result;
} }
QVariantMap RangeTimelineModel::details(int index) const QVariantMap QmlProfilerRangeModel::details(int index) const
{ {
Q_D(const RangeTimelineModel); Q_D(const QmlProfilerRangeModel);
QVariantMap result; QVariantMap result;
int id = selectionId(index); int id = selectionId(index);
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = const QVector<QmlProfilerDataModel::QmlEventTypeData> &types =
@@ -273,9 +273,9 @@ QVariantMap RangeTimelineModel::details(int index) const
return result; return result;
} }
QVariantMap RangeTimelineModel::location(int index) const QVariantMap QmlProfilerRangeModel::location(int index) const
{ {
Q_D(const RangeTimelineModel); Q_D(const QmlProfilerRangeModel);
QVariantMap result; QVariantMap result;
int id = selectionId(index); int id = selectionId(index);
@@ -289,9 +289,9 @@ QVariantMap RangeTimelineModel::location(int index) const
return result; 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) if (typeId < 0)
return false; return false;
const QmlProfilerDataModel::QmlEventTypeData &type = const QmlProfilerDataModel::QmlEventTypeData &type =
@@ -301,9 +301,9 @@ bool RangeTimelineModel::isSelectionIdValid(int typeId) const
return true; 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 // if this is called from v8 view, we don't have the column number, it will be -1
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = const QVector<QmlProfilerDataModel::QmlEventTypeData> &types =
d->modelManager->qmlModel()->getEventTypes(); d->modelManager->qmlModel()->getEventTypes();

View File

@@ -29,8 +29,8 @@
****************************************************************************/ ****************************************************************************/
#ifndef QMLPROFILERTIMELINEMODELPROXY_H #ifndef QMLPROFILERRANGEMODEL_H
#define QMLPROFILERTIMELINEMODELPROXY_H #define QMLPROFILERRANGEMODEL_H
#include "abstracttimelinemodel.h" #include "abstracttimelinemodel.h"
#include <qmldebug/qmlprofilereventtypes.h> #include <qmldebug/qmlprofilereventtypes.h>
@@ -44,7 +44,7 @@ class QmlProfilerModelManager;
namespace Internal { namespace Internal {
class RangeTimelineModel : public AbstractTimelineModel class QmlProfilerRangeModel : public AbstractTimelineModel
{ {
Q_OBJECT Q_OBJECT
public: public:
@@ -61,7 +61,7 @@ public:
int bindingLoopHead; int bindingLoopHead;
}; };
RangeTimelineModel(QmlDebug::RangeType rangeType, QObject *parent = 0); QmlProfilerRangeModel(QmlDebug::RangeType rangeType, QObject *parent = 0);
static QString categoryLabel(QmlDebug::RangeType categoryIndex); static QString categoryLabel(QmlDebug::RangeType categoryIndex);
quint64 features() const; quint64 features() const;
@@ -82,11 +82,11 @@ protected:
void clear(); void clear();
private: private:
class RangeTimelineModelPrivate; class QmlProfilerRangeModelPrivate;
Q_DECLARE_PRIVATE(RangeTimelineModel) Q_DECLARE_PRIVATE(QmlProfilerRangeModel)
}; };
} }
} }
#endif #endif // QMLPROFILERRANGEMODEL_H

View File

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

View File

@@ -32,7 +32,6 @@
#include "qmlprofilertool.h" #include "qmlprofilertool.h"
#include "qmlprofilerstatemanager.h" #include "qmlprofilerstatemanager.h"
#include "qmlprofilermodelmanager.h" #include "qmlprofilermodelmanager.h"
#include "qmlprofilertimelinemodelproxy.h"
#include "timelinemodelaggregator.h" #include "timelinemodelaggregator.h"
// Needed for the load&save actions in the context menu // Needed for the load&save actions in the context menu

View File

@@ -30,10 +30,10 @@
#include "timelinemodelaggregator.h" #include "timelinemodelaggregator.h"
#include "qmlprofilertimelinemodelproxy.h" #include "qmlprofilerrangemodel.h"
#include "qmlprofilerpainteventsmodelproxy.h" #include "qmlprofileranimationsmodel.h"
#include "qmlprofilerplugin.h" #include "qmlprofilerplugin.h"
#include "notesmodel.h" #include "qmlprofilernotesmodel.h"
#include <QStringList> #include <QStringList>
#include <QVariant> #include <QVariant>
@@ -85,12 +85,12 @@ void TimelineModelAggregator::setModelManager(QmlProfilerModelManager *modelMana
addModel(timelineModel); addModel(timelineModel);
} }
PaintEventsModelProxy *paintEventsModelProxy = new PaintEventsModelProxy(this); QmlProfilerAnimationsModel *paintEventsModelProxy = new QmlProfilerAnimationsModel(this);
paintEventsModelProxy->setModelManager(modelManager); paintEventsModelProxy->setModelManager(modelManager);
addModel(paintEventsModelProxy); addModel(paintEventsModelProxy);
for (int i = 0; i < QmlDebug::MaximumRangeType; ++i) { 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); rangeModel->setModelManager(modelManager);
addModel(rangeModel); addModel(rangeModel);
} }
@@ -133,7 +133,7 @@ int TimelineModelAggregator::modelIndexFromManagerIndex(int modelManagerIndex) c
return d->modelManagerIndexMapping[modelManagerIndex]; return d->modelManagerIndexMapping[modelManagerIndex];
} }
NotesModel *TimelineModelAggregator::notes() const QmlProfilerNotesModel *TimelineModelAggregator::notes() const
{ {
return d->modelManager->notesModel(); 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) void TimelineModelAggregator::setNoteText(int modelIndex, int index, const QString &text)
{ {
int managerId = d->modelList[modelIndex]->modelId(); int managerId = d->modelList[modelIndex]->modelId();
NotesModel *notesModel = notes(); QmlProfilerNotesModel *notesModel = notes();
int noteId = notesModel->get(managerId, index); int noteId = notesModel->get(managerId, index);
if (noteId == -1) { if (noteId == -1) {
if (text.length() > 0) if (text.length() > 0)

View File

@@ -53,7 +53,7 @@ public:
QVariantList models() const; QVariantList models() const;
int modelIndexFromManagerIndex(int modelManagerIndex) const; int modelIndexFromManagerIndex(int modelManagerIndex) const;
Q_INVOKABLE NotesModel *notes() const; Q_INVOKABLE QmlProfilerNotesModel *notes() const;
Q_INVOKABLE int count(int modelIndex) const; Q_INVOKABLE int count(int modelIndex) const;
void clear(); void clear();
Q_INVOKABLE int modelCount() const; Q_INVOKABLE int modelCount() const;

View File

@@ -29,7 +29,7 @@
****************************************************************************/ ****************************************************************************/
#include "timelinerenderer.h" #include "timelinerenderer.h"
#include "notesmodel.h" #include "qmlprofilernotesmodel.h"
#include <QQmlContext> #include <QQmlContext>
#include <QQmlProperty> #include <QQmlProperty>
@@ -365,7 +365,7 @@ void TimelineRenderer::drawNotes(QPainter *p)
static const int annotationSpace = 4; static const int annotationSpace = 4;
static const int shadowOffset = 2; static const int shadowOffset = 2;
NotesModel *notes = m_profilerModelProxy->notes(); QmlProfilerNotesModel *notes = m_profilerModelProxy->notes();
for (int i = 0; i < notes->count(); ++i) { for (int i = 0; i < notes->count(); ++i) {
int managerIndex = notes->timelineModel(i); int managerIndex = notes->timelineModel(i);
if (managerIndex == -1) if (managerIndex == -1)

View File

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