Adapt to renaming of get* and find* methods

Change-Id: I470bcaaf53a6184ae35369484337b247bf17f52e
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-07-08 14:53:47 +02:00
parent 2c4214825c
commit b7cd23a466
6 changed files with 45 additions and 46 deletions

View File

@@ -59,7 +59,7 @@ int MemoryUsageModel::rowMaxValue(int rowNumber) const
return d->maxSize; return d->maxSize;
} }
int MemoryUsageModel::getEventRow(int index) const int MemoryUsageModel::row(int index) const
{ {
Q_D(const MemoryUsageModel); Q_D(const MemoryUsageModel);
QmlDebug::MemoryType type = d->range(index).type; QmlDebug::MemoryType type = d->range(index).type;
@@ -69,24 +69,24 @@ int MemoryUsageModel::getEventRow(int index) const
return 2; return 2;
} }
int MemoryUsageModel::getEventId(int index) const int MemoryUsageModel::eventId(int index) const
{ {
Q_D(const MemoryUsageModel); Q_D(const MemoryUsageModel);
return d->range(index).type; return d->range(index).type;
} }
QColor MemoryUsageModel::getColor(int index) const QColor MemoryUsageModel::color(int index) const
{ {
return getEventColor(index); return colorByEventId(index);
} }
float MemoryUsageModel::getHeight(int index) const float MemoryUsageModel::height(int index) const
{ {
Q_D(const MemoryUsageModel); Q_D(const MemoryUsageModel);
return qMin(1.0f, (float)d->range(index).size / (float)d->maxSize); return qMin(1.0f, (float)d->range(index).size / (float)d->maxSize);
} }
const QVariantMap MemoryUsageModel::getEventLocation(int index) const QVariantMap MemoryUsageModel::location(int index) const
{ {
static const QLatin1String file("file"); static const QLatin1String file("file");
static const QLatin1String line("line"); static const QLatin1String line("line");
@@ -108,7 +108,7 @@ const QVariantMap MemoryUsageModel::getEventLocation(int index) const
return result; return result;
} }
const QVariantList MemoryUsageModel::getLabels() const QVariantList MemoryUsageModel::labels() const
{ {
Q_D(const MemoryUsageModel); Q_D(const MemoryUsageModel);
QVariantList result; QVariantList result;
@@ -134,7 +134,7 @@ const QVariantList MemoryUsageModel::getLabels() const
return result; return result;
} }
const QVariantList MemoryUsageModel::getEventDetails(int index) const QVariantList MemoryUsageModel::details(int index) const
{ {
Q_D(const MemoryUsageModel); Q_D(const MemoryUsageModel);
@@ -200,7 +200,7 @@ void MemoryUsageModel::loadData()
const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex]; const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex];
while (!rangeStack.empty() && rangeStack.top().endTime < event.startTime) while (!rangeStack.empty() && rangeStack.top().endTime < event.startTime)
rangeStack.pop(); rangeStack.pop();
if (!eventAccepted(type)) { if (!accepted(type)) {
if (type.rangeType != QmlDebug::MaximumRangeType) { if (type.rangeType != QmlDebug::MaximumRangeType) {
rangeStack.push(RangeStackFrame(event.typeIndex, event.startTime, rangeStack.push(RangeStackFrame(event.typeIndex, event.startTime,
event.startTime + event.duration)); event.startTime + event.duration));

View File

@@ -53,15 +53,15 @@ public:
int rowCount() const; int rowCount() const;
int rowMaxValue(int rowNumber) const; int rowMaxValue(int rowNumber) const;
int getEventRow(int index) const; int row(int index) const;
int getEventId(int index) const; int eventId(int index) const;
QColor getColor(int index) const; QColor color(int index) const;
float getHeight(int index) const; float height(int index) const;
const QVariantMap getEventLocation(int index) const; QVariantMap location(int index) const;
const QVariantList getLabels() const; QVariantList labels() const;
const QVariantList getEventDetails(int index) const; QVariantList details(int index) const;
void loadData(); void loadData();
void clear(); void clear();

View File

@@ -111,31 +111,31 @@ int PixmapCacheModel::rowMaxValue(int rowNumber) const
} }
} }
int PixmapCacheModel::getEventRow(int index) const int PixmapCacheModel::row(int index) const
{ {
Q_D(const PixmapCacheModel); Q_D(const PixmapCacheModel);
if (d->expanded) if (d->expanded)
return getEventId(index) + 1; return eventId(index) + 1;
return d->range(index).rowNumberCollapsed; return d->range(index).rowNumberCollapsed;
} }
int PixmapCacheModel::getEventId(int index) const int PixmapCacheModel::eventId(int index) const
{ {
Q_D(const PixmapCacheModel); Q_D(const PixmapCacheModel);
return d->range(index).pixmapEventType == PixmapCacheCountChanged ? return d->range(index).pixmapEventType == PixmapCacheCountChanged ?
0 : d->range(index).urlIndex + 1; 0 : d->range(index).urlIndex + 1;
} }
QColor PixmapCacheModel::getColor(int index) const QColor PixmapCacheModel::color(int index) const
{ {
Q_D(const PixmapCacheModel); Q_D(const PixmapCacheModel);
if (d->range(index).pixmapEventType == PixmapCacheCountChanged) if (d->range(index).pixmapEventType == PixmapCacheCountChanged)
return getColorByHue(PixmapCacheCountHue); return colorByHue(PixmapCacheCountHue);
return getEventColor(index); return colorByEventId(index);
} }
float PixmapCacheModel::getHeight(int index) const float PixmapCacheModel::height(int index) const
{ {
Q_D(const PixmapCacheModel); Q_D(const PixmapCacheModel);
if (d->range(index).pixmapEventType == PixmapCacheCountChanged) if (d->range(index).pixmapEventType == PixmapCacheCountChanged)
@@ -152,7 +152,7 @@ QString getFilenameOnly(QString absUrl)
return absUrl; return absUrl;
} }
const QVariantList PixmapCacheModel::getLabels() const QVariantList PixmapCacheModel::labels() const
{ {
Q_D(const PixmapCacheModel); Q_D(const PixmapCacheModel);
QVariantList result; QVariantList result;
@@ -190,7 +190,7 @@ void PixmapCacheModel::PixmapCacheModelPrivate::addVP(QVariantList &l, QString l
} }
} }
const QVariantList PixmapCacheModel::getEventDetails(int index) const QVariantList PixmapCacheModel::details(int index) const
{ {
Q_D(const PixmapCacheModel); Q_D(const PixmapCacheModel);
QVariantList result; QVariantList result;
@@ -285,7 +285,7 @@ void PixmapCacheModel::loadData()
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes(); const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes();
foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) { foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) {
const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex]; const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex];
if (!eventAccepted(type)) if (!accepted(type))
continue; continue;
PixmapCacheEvent newEvent; PixmapCacheEvent newEvent;

View File

@@ -58,14 +58,14 @@ public:
int rowCount() const; int rowCount() const;
int rowMaxValue(int rowNumber) const; int rowMaxValue(int rowNumber) const;
int getEventRow(int index) const; int row(int index) const;
Q_INVOKABLE int getEventId(int index) const; int eventId(int index) const;
Q_INVOKABLE QColor getColor(int index) const; QColor color(int index) const;
Q_INVOKABLE float getHeight(int index) const; float height(int index) const;
const QVariantList getLabels() const; QVariantList labels() const;
Q_INVOKABLE const QVariantList getEventDetails(int index) const; QVariantList details(int index) const;
void loadData(); void loadData();
void clear(); void clear();

View File

@@ -79,22 +79,22 @@ int SceneGraphTimelineModel::rowCount() const
return d->seenPolishAndSync ? 3 : 2; return d->seenPolishAndSync ? 3 : 2;
} }
int SceneGraphTimelineModel::getEventRow(int index) const int SceneGraphTimelineModel::row(int index) const
{ {
Q_D(const SceneGraphTimelineModel); Q_D(const SceneGraphTimelineModel);
return d->seenPolishAndSync ? d->range(index).sgEventType + 1 : 1; return d->seenPolishAndSync ? d->range(index).sgEventType + 1 : 1;
} }
int SceneGraphTimelineModel::getEventId(int index) const int SceneGraphTimelineModel::eventId(int index) const
{ {
Q_D(const SceneGraphTimelineModel); Q_D(const SceneGraphTimelineModel);
return d->seenPolishAndSync ? d->range(index).sgEventType : SceneGraphGUIThread; return d->seenPolishAndSync ? d->range(index).sgEventType : SceneGraphGUIThread;
} }
QColor SceneGraphTimelineModel::getColor(int index) const QColor SceneGraphTimelineModel::color(int index) const
{ {
// get duration in seconds // get duration in seconds
double eventDuration = getDuration(index) / 1e9; double eventDuration = duration(index) / 1e9;
// supposedly never above 60 frames per second // supposedly never above 60 frames per second
// limit it in that case // limit it in that case
@@ -105,7 +105,7 @@ QColor SceneGraphTimelineModel::getColor(int index) const
double fpsFraction = 1 / (eventDuration * 60.0); double fpsFraction = 1 / (eventDuration * 60.0);
if (fpsFraction > 1.0) if (fpsFraction > 1.0)
fpsFraction = 1.0; fpsFraction = 1.0;
return getFractionColor(fpsFraction); return colorByFraction(fpsFraction);
} }
QString labelForSGType(int t) QString labelForSGType(int t)
@@ -119,7 +119,7 @@ QString labelForSGType(int t)
} }
} }
const QVariantList SceneGraphTimelineModel::getLabels() const QVariantList SceneGraphTimelineModel::labels() const
{ {
Q_D(const SceneGraphTimelineModel); Q_D(const SceneGraphTimelineModel);
QVariantList result; QVariantList result;
@@ -154,8 +154,7 @@ void SceneGraphTimelineModel::SceneGraphTimelineModelPrivate::addVP(QVariantList
} }
} }
QVariantList SceneGraphTimelineModel::details(int index) const
const QVariantList SceneGraphTimelineModel::getEventDetails(int index) const
{ {
Q_D(const SceneGraphTimelineModel); Q_D(const SceneGraphTimelineModel);
QVariantList result; QVariantList result;
@@ -214,7 +213,7 @@ void SceneGraphTimelineModel::loadData()
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes(); const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes();
foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) { foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) {
const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex]; const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex];
if (!eventAccepted(type)) if (!accepted(type))
continue; continue;
if (type.detailType == SceneGraphRenderLoopFrame) { if (type.detailType == SceneGraphRenderLoopFrame) {

View File

@@ -45,13 +45,13 @@ public:
int rowCount() const; int rowCount() const;
int getEventRow(int index) const; int row(int index) const;
Q_INVOKABLE int getEventId(int index) const; int eventId(int index) const;
Q_INVOKABLE QColor getColor(int index) const; QColor color(int index) const;
const QVariantList getLabels() const; QVariantList labels() const;
Q_INVOKABLE const QVariantList getEventDetails(int index) const; QVariantList details(int index) const;
void loadData(); void loadData();
void clear(); void clear();