Commit e10bc709 authored by Ulf Hermann's avatar Ulf Hermann

QmlProfiler: Provide a sane ctor for QmlEventType and use it

... in turn, make its members private, so that we don't accidentally
change them.

Change-Id: Ibc65b406ee341d33f69647ed1b19e1e34f5cd535
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent 5718f12a
...@@ -76,10 +76,10 @@ QVariantMap DebugMessagesModel::details(int index) const ...@@ -76,10 +76,10 @@ QVariantMap DebugMessagesModel::details(int index) const
const QmlEventType &type = modelManager()->qmlModel()->eventTypes()[m_data[index].typeId]; const QmlEventType &type = modelManager()->qmlModel()->eventTypes()[m_data[index].typeId];
QVariantMap result; QVariantMap result;
result.insert(QLatin1String("displayName"), messageType(type.detailType)); result.insert(QLatin1String("displayName"), messageType(type.detailType()));
result.insert(tr("Timestamp"), QmlProfilerDataModel::formatTime(startTime(index))); result.insert(tr("Timestamp"), QmlProfilerDataModel::formatTime(startTime(index)));
result.insert(tr("Message"), m_data[index].text); result.insert(tr("Message"), m_data[index].text);
result.insert(tr("Location"), type.displayName); result.insert(tr("Location"), type.displayName());
return result; return result;
} }
...@@ -96,9 +96,9 @@ int DebugMessagesModel::collapsedRow(int index) const ...@@ -96,9 +96,9 @@ int DebugMessagesModel::collapsedRow(int index) const
void DebugMessagesModel::loadEvent(const QmlEvent &event, const QmlEventType &type) void DebugMessagesModel::loadEvent(const QmlEvent &event, const QmlEventType &type)
{ {
m_data.insert(insert(event.timestamp(), 0, type.detailType), m_data.insert(insert(event.timestamp(), 0, type.detailType()),
MessageData(event.string(), event.typeIndex())); MessageData(event.string(), event.typeIndex()));
if (type.detailType > m_maximumMsgType) if (type.detailType() > m_maximumMsgType)
m_maximumMsgType = event.typeIndex(); m_maximumMsgType = event.typeIndex();
} }
......
...@@ -168,14 +168,14 @@ QVariant FlameGraphModel::lookup(const FlameGraphData &stats, int role) const ...@@ -168,14 +168,14 @@ QVariant FlameGraphModel::lookup(const FlameGraphData &stats, int role) const
const QmlEventType &type = typeList[stats.typeIndex]; const QmlEventType &type = typeList[stats.typeIndex];
switch (role) { switch (role) {
case FilenameRole: return type.location.filename(); case FilenameRole: return type.location().filename();
case LineRole: return type.location.line(); case LineRole: return type.location().line();
case ColumnRole: return type.location.column(); case ColumnRole: return type.location().column();
case TypeRole: return nameForType(type.rangeType); case TypeRole: return nameForType(type.rangeType());
case RangeTypeRole: return type.rangeType; case RangeTypeRole: return type.rangeType();
case DetailsRole: return type.data.isEmpty() ? case DetailsRole: return type.data().isEmpty() ?
FlameGraphModel::tr("Source code not available") : type.data; FlameGraphModel::tr("Source code not available") : type.data();
case LocationRole: return type.displayName; case LocationRole: return type.displayName();
default: return QVariant(); default: return QVariant();
} }
} else { } else {
......
...@@ -142,11 +142,11 @@ int InputEventsModel::collapsedRow(int index) const ...@@ -142,11 +142,11 @@ int InputEventsModel::collapsedRow(int index) const
void InputEventsModel::loadEvent(const QmlEvent &event, const QmlEventType &type) void InputEventsModel::loadEvent(const QmlEvent &event, const QmlEventType &type)
{ {
m_data.insert(insert(event.timestamp(), 0, type.detailType), m_data.insert(insert(event.timestamp(), 0, type.detailType()),
InputEvent(static_cast<InputEventType>(event.number<qint32>(0)), InputEvent(static_cast<InputEventType>(event.number<qint32>(0)),
event.number<qint32>(1), event.number<qint32>(2))); event.number<qint32>(1), event.number<qint32>(2)));
if (type.detailType == Mouse) { if (type.detailType() == Mouse) {
if (m_mouseTypeId == -1) if (m_mouseTypeId == -1)
m_mouseTypeId = event.typeIndex(); m_mouseTypeId = event.typeIndex();
} else if (m_keyTypeId == -1) { } else if (m_keyTypeId == -1) {
...@@ -170,7 +170,7 @@ void InputEventsModel::clear() ...@@ -170,7 +170,7 @@ void InputEventsModel::clear()
bool InputEventsModel::accepted(const QmlEventType &type) const bool InputEventsModel::accepted(const QmlEventType &type) const
{ {
return QmlProfilerTimelineModel::accepted(type) && return QmlProfilerTimelineModel::accepted(type) &&
(type.detailType == Mouse || type.detailType == Key); (type.detailType() == Mouse || type.detailType() == Key);
} }
InputEventsModel::InputEvent::InputEvent(InputEventType type, int a, int b) : InputEventsModel::InputEvent::InputEvent(InputEventType type, int a, int b) :
......
...@@ -122,19 +122,19 @@ QVariantMap MemoryUsageModel::details(int index) const ...@@ -122,19 +122,19 @@ QVariantMap MemoryUsageModel::details(int index) const
result.insert(tr("Type"), memoryTypeName); result.insert(tr("Type"), memoryTypeName);
result.insert(tr("Location"), result.insert(tr("Location"),
modelManager()->qmlModel()->eventTypes().at(ev->typeId).displayName); modelManager()->qmlModel()->eventTypes().at(ev->typeId).displayName());
return result; return result;
} }
bool MemoryUsageModel::accepted(const QmlEventType &type) const bool MemoryUsageModel::accepted(const QmlEventType &type) const
{ {
return QmlProfilerTimelineModel::accepted(type) || type.rangeType != MaximumRangeType; return QmlProfilerTimelineModel::accepted(type) || type.rangeType() != MaximumRangeType;
} }
void MemoryUsageModel::loadEvent(const QmlEvent &event, const QmlEventType &type) void MemoryUsageModel::loadEvent(const QmlEvent &event, const QmlEventType &type)
{ {
if (type.message != MemoryAllocation) { if (type.message() != MemoryAllocation) {
if (type.rangeType != MaximumRangeType) { if (type.rangeType() != MaximumRangeType) {
if (event.rangeStage() == RangeStart) if (event.rangeStage() == RangeStart)
m_rangeStack.push(RangeStackFrame(event.typeIndex(), event.timestamp())); m_rangeStack.push(RangeStackFrame(event.typeIndex(), event.timestamp()));
else if (event.rangeStage() == RangeEnd) else if (event.rangeStage() == RangeEnd)
...@@ -164,7 +164,7 @@ void MemoryUsageModel::loadEvent(const QmlEvent &event, const QmlEventType &type ...@@ -164,7 +164,7 @@ void MemoryUsageModel::loadEvent(const QmlEvent &event, const QmlEventType &type
} }
}; };
if (type.detailType == SmallItem || type.detailType == LargeItem) { if (type.detailType() == SmallItem || type.detailType() == LargeItem) {
if (canContinue(ContinueUsage)) { if (canContinue(ContinueUsage)) {
m_data[m_currentUsageIndex].update(event.number<qint64>(0)); m_data[m_currentUsageIndex].update(event.number<qint64>(0));
m_currentUsage = m_data[m_currentUsageIndex].size; m_currentUsage = m_data[m_currentUsageIndex].size;
...@@ -186,9 +186,9 @@ void MemoryUsageModel::loadEvent(const QmlEvent &event, const QmlEventType &type ...@@ -186,9 +186,9 @@ void MemoryUsageModel::loadEvent(const QmlEvent &event, const QmlEventType &type
} }
} }
if (type.detailType == HeapPage || type.detailType == LargeItem) { if (type.detailType() == HeapPage || type.detailType() == LargeItem) {
if (canContinue(ContinueAllocation) if (canContinue(ContinueAllocation)
&& type.detailType == selectionId(m_currentJSHeapIndex)) { && type.detailType() == selectionId(m_currentJSHeapIndex)) {
m_data[m_currentJSHeapIndex].update(event.number<qint64>(0)); m_data[m_currentJSHeapIndex].update(event.number<qint64>(0));
m_currentSize = m_data[m_currentJSHeapIndex].size; m_currentSize = m_data[m_currentJSHeapIndex].size;
} else { } else {
...@@ -204,7 +204,7 @@ void MemoryUsageModel::loadEvent(const QmlEvent &event, const QmlEventType &type ...@@ -204,7 +204,7 @@ void MemoryUsageModel::loadEvent(const QmlEvent &event, const QmlEventType &type
if (m_currentJSHeapIndex != -1) if (m_currentJSHeapIndex != -1)
insertEnd(m_currentJSHeapIndex, insertEnd(m_currentJSHeapIndex,
event.timestamp() - startTime(m_currentJSHeapIndex) - 1); event.timestamp() - startTime(m_currentJSHeapIndex) - 1);
m_currentJSHeapIndex = insertStart(event.timestamp(), type.detailType); m_currentJSHeapIndex = insertStart(event.timestamp(), type.detailType());
m_data.insert(m_currentJSHeapIndex, allocation); m_data.insert(m_currentJSHeapIndex, allocation);
m_continuation = m_continuation | ContinueAllocation; m_continuation = m_continuation | ContinueAllocation;
} }
......
...@@ -163,13 +163,13 @@ QVariantMap PixmapCacheModel::details(int index) const ...@@ -163,13 +163,13 @@ QVariantMap PixmapCacheModel::details(int index) const
void PixmapCacheModel::loadEvent(const QmlEvent &event, const QmlEventType &type) void PixmapCacheModel::loadEvent(const QmlEvent &event, const QmlEventType &type)
{ {
PixmapCacheItem newEvent; PixmapCacheItem newEvent;
const PixmapEventType pixmapType = static_cast<PixmapEventType>(type.detailType); const PixmapEventType pixmapType = static_cast<PixmapEventType>(type.detailType());
newEvent.pixmapEventType = pixmapType; newEvent.pixmapEventType = pixmapType;
qint64 pixmapStartTime = event.timestamp(); qint64 pixmapStartTime = event.timestamp();
newEvent.urlIndex = -1; newEvent.urlIndex = -1;
for (auto i = m_pixmaps.cend(), begin = m_pixmaps.cbegin(); i != begin;) { for (auto i = m_pixmaps.cend(), begin = m_pixmaps.cbegin(); i != begin;) {
if ((--i)->url == type.location.filename()) { if ((--i)->url == type.location().filename()) {
newEvent.urlIndex = i - m_pixmaps.cbegin(); newEvent.urlIndex = i - m_pixmaps.cbegin();
break; break;
} }
...@@ -178,7 +178,7 @@ void PixmapCacheModel::loadEvent(const QmlEvent &event, const QmlEventType &type ...@@ -178,7 +178,7 @@ void PixmapCacheModel::loadEvent(const QmlEvent &event, const QmlEventType &type
newEvent.sizeIndex = -1; newEvent.sizeIndex = -1;
if (newEvent.urlIndex == -1) { if (newEvent.urlIndex == -1) {
newEvent.urlIndex = m_pixmaps.count(); newEvent.urlIndex = m_pixmaps.count();
m_pixmaps << Pixmap(type.location.filename()); m_pixmaps << Pixmap(type.location().filename());
} }
Pixmap &pixmap = m_pixmaps[newEvent.urlIndex]; Pixmap &pixmap = m_pixmaps[newEvent.urlIndex];
......
...@@ -32,18 +32,45 @@ QDataStream &operator>>(QDataStream &stream, QmlEventType &type) ...@@ -32,18 +32,45 @@ QDataStream &operator>>(QDataStream &stream, QmlEventType &type)
{ {
quint8 message; quint8 message;
quint8 rangeType; quint8 rangeType;
stream >> type.displayName >> type.data >> type.location >> message >> rangeType stream >> type.m_displayName >> type.m_data >> type.m_location >> message >> rangeType
>> type.detailType; >> type.m_detailType;
type.message = static_cast<Message>(message); type.m_message = static_cast<Message>(message);
type.rangeType = static_cast<RangeType>(rangeType); type.m_rangeType = static_cast<RangeType>(rangeType);
return stream; return stream;
} }
QDataStream &operator<<(QDataStream &stream, const QmlEventType &type) QDataStream &operator<<(QDataStream &stream, const QmlEventType &type)
{ {
return stream << type.displayName << type.data << type.location return stream << type.m_displayName << type.m_data << type.m_location
<< static_cast<quint8>(type.message) << static_cast<quint8>(type.rangeType) << static_cast<quint8>(type.m_message) << static_cast<quint8>(type.m_rangeType)
<< type.detailType; << type.m_detailType;
}
ProfileFeature QmlEventType::feature() const
{
switch (m_message) {
case Event: {
switch (m_detailType) {
case Mouse:
case Key:
return ProfileInputEvents;
case AnimationFrame:
return ProfileAnimations;
default:
return MaximumProfileFeature;
}
}
case PixmapCacheEvent:
return ProfilePixmapCache;
case SceneGraphFrame:
return ProfileSceneGraph;
case MemoryAllocation:
return ProfileMemory;
case DebugMessage:
return ProfileDebugMessages;
default:
return featureFromRangeType(m_rangeType);
}
} }
......
...@@ -31,48 +31,37 @@ ...@@ -31,48 +31,37 @@
namespace QmlProfiler { namespace QmlProfiler {
struct QmlEventType { class QmlEventType {
QmlEventType(const QString &displayName = QString(), public:
const QmlEventLocation &location = QmlEventLocation(), QmlEventType(Message message = MaximumMessage, RangeType rangeType = MaximumRangeType,
Message message = MaximumMessage, RangeType rangeType = MaximumRangeType, int detailType = -1, const QmlEventLocation &location = QmlEventLocation(),
int detailType = -1, const QString &data = QString()) : const QString &data = QString(), const QString displayName = QString()) :
displayName(displayName), data(data), location(location), message(message), m_displayName(displayName), m_data(data), m_location(location), m_message(message),
rangeType(rangeType), detailType(detailType) m_rangeType(rangeType), m_detailType(detailType)
{} {}
QString displayName; void setDisplayName(const QString &displayName) { m_displayName = displayName; }
QString data; void setData(const QString &data) { m_data = data; }
QmlEventLocation location; void setLocation(const QmlEventLocation &location) { m_location = location; }
Message message;
RangeType rangeType;
int detailType; // can be EventType, BindingType, PixmapEventType or SceneGraphFrameType
ProfileFeature feature() const ProfileFeature feature() const;
{ QString displayName() const { return m_displayName; }
switch (message) { QString data() const { return m_data; }
case Event: { QmlEventLocation location() const { return m_location; }
switch (detailType) { Message message() const { return m_message; }
case Mouse: RangeType rangeType() const { return m_rangeType; }
case Key: int detailType() const { return m_detailType; }
return ProfileInputEvents;
case AnimationFrame: private:
return ProfileAnimations; friend QDataStream &operator>>(QDataStream &stream, QmlEventType &type);
default: friend QDataStream &operator<<(QDataStream &stream, const QmlEventType &type);
return MaximumProfileFeature;
} QString m_displayName;
} QString m_data;
case PixmapCacheEvent: QmlEventLocation m_location;
return ProfilePixmapCache; Message m_message;
case SceneGraphFrame: RangeType m_rangeType;
return ProfileSceneGraph; int m_detailType; // can be EventType, BindingType, PixmapEventType or SceneGraphFrameType
case MemoryAllocation:
return ProfileMemory;
case DebugMessage:
return ProfileDebugMessages;
default:
return featureFromRangeType(rangeType);
}
}
}; };
QDataStream &operator>>(QDataStream &stream, QmlEventType &type); QDataStream &operator>>(QDataStream &stream, QmlEventType &type);
......
...@@ -57,7 +57,7 @@ void QmlProfilerAnimationsModel::clear() ...@@ -57,7 +57,7 @@ void QmlProfilerAnimationsModel::clear()
bool QmlProfilerAnimationsModel::accepted(const QmlEventType &event) const bool QmlProfilerAnimationsModel::accepted(const QmlEventType &event) const
{ {
return QmlProfilerTimelineModel::accepted(event) && event.detailType == AnimationFrame; return QmlProfilerTimelineModel::accepted(event) && event.detailType() == AnimationFrame;
} }
void QmlProfilerAnimationsModel::loadEvent(const QmlEvent &event, const QmlEventType &type) void QmlProfilerAnimationsModel::loadEvent(const QmlEvent &event, const QmlEventType &type)
......
...@@ -57,24 +57,23 @@ public: ...@@ -57,24 +57,23 @@ public:
QString getDisplayName(const QmlEventType &event) QString getDisplayName(const QmlEventType &event)
{ {
if (event.location.filename().isEmpty()) { if (event.location().filename().isEmpty()) {
return QmlProfilerDataModel::tr("<bytecode>"); return QmlProfilerDataModel::tr("<bytecode>");
} else { } else {
const QString filePath = QUrl(event.location.filename()).path(); const QString filePath = QUrl(event.location().filename()).path();
return filePath.mid(filePath.lastIndexOf(QLatin1Char('/')) + 1) + QLatin1Char(':') + return filePath.mid(filePath.lastIndexOf(QLatin1Char('/')) + 1) + QLatin1Char(':') +
QString::number(event.location.line()); QString::number(event.location().line());
} }
} }
QString getInitialDetails(const QmlEventType &event) QString getInitialDetails(const QmlEventType &event)
{ {
QString details; QString details = event.data();
// generate details string // generate details string
if (!event.data.isEmpty()) { if (!details.isEmpty()) {
details = event.data;
details = details.replace(QLatin1Char('\n'),QLatin1Char(' ')).simplified(); details = details.replace(QLatin1Char('\n'),QLatin1Char(' ')).simplified();
if (details.isEmpty()) { if (details.isEmpty()) {
if (event.rangeType == Javascript) if (event.rangeType() == Javascript)
details = QmlProfilerDataModel::tr("anonymous function"); details = QmlProfilerDataModel::tr("anonymous function");
} else { } else {
QRegExp rewrite(QLatin1String("\\(function \\$(\\w+)\\(\\) \\{ (return |)(.+) \\}\\)")); QRegExp rewrite(QLatin1String("\\(function \\$(\\w+)\\(\\) \\{ (return |)(.+) \\}\\)"));
...@@ -85,7 +84,7 @@ QString getInitialDetails(const QmlEventType &event) ...@@ -85,7 +84,7 @@ QString getInitialDetails(const QmlEventType &event)
details.startsWith(QLatin1String("qrc:/"))) details.startsWith(QLatin1String("qrc:/")))
details = details.mid(details.lastIndexOf(QLatin1Char('/')) + 1); details = details.mid(details.lastIndexOf(QLatin1Char('/')) + 1);
} }
} else if (event.rangeType == Painting) { } else if (event.rangeType() == Painting) {
// QtQuick1 animations always run in GUI thread. // QtQuick1 animations always run in GUI thread.
details = QmlProfilerDataModel::tr("GUI Thread"); details = QmlProfilerDataModel::tr("GUI Thread");
} }
...@@ -174,18 +173,18 @@ bool QmlProfilerDataModel::isEmpty() const ...@@ -174,18 +173,18 @@ bool QmlProfilerDataModel::isEmpty() const
void QmlProfilerDataModel::QmlProfilerDataModelPrivate::rewriteType(int typeIndex) void QmlProfilerDataModel::QmlProfilerDataModelPrivate::rewriteType(int typeIndex)
{ {
QmlEventType &type = eventTypes[typeIndex]; QmlEventType &type = eventTypes[typeIndex];
type.displayName = getDisplayName(type); type.setDisplayName(getDisplayName(type));
type.data = getInitialDetails(type); type.setData(getInitialDetails(type));
// Only bindings and signal handlers need rewriting // Only bindings and signal handlers need rewriting
if (type.rangeType != Binding && type.rangeType != HandlingSignal) if (type.rangeType() != Binding && type.rangeType() != HandlingSignal)
return; return;
// There is no point in looking for invalid locations // There is no point in looking for invalid locations
if (!type.location.isValid()) if (!type.location().isValid())
return; return;
detailsRewriter->requestDetailsForLocation(typeIndex, type.location); detailsRewriter->requestDetailsForLocation(typeIndex, type.location());
} }
void QmlProfilerDataModel::replayEvents(qint64 rangeStart, qint64 rangeEnd, void QmlProfilerDataModel::replayEvents(qint64 rangeStart, qint64 rangeEnd,
...@@ -205,7 +204,7 @@ void QmlProfilerDataModel::replayEvents(qint64 rangeStart, qint64 rangeEnd, ...@@ -205,7 +204,7 @@ void QmlProfilerDataModel::replayEvents(qint64 rangeStart, qint64 rangeEnd,
const QmlEventType &type = d->eventTypes[event.typeIndex()]; const QmlEventType &type = d->eventTypes[event.typeIndex()];
if (rangeStart != -1 && rangeEnd != -1) { if (rangeStart != -1 && rangeEnd != -1) {
if (event.timestamp() < rangeStart) { if (event.timestamp() < rangeStart) {
if (type.rangeType != MaximumRangeType) { if (type.rangeType() != MaximumRangeType) {
if (event.rangeStage() == RangeStart) if (event.rangeStage() == RangeStart)
stack.push(event); stack.push(event);
else if (event.rangeStage() == RangeEnd) else if (event.rangeStage() == RangeEnd)
...@@ -213,7 +212,7 @@ void QmlProfilerDataModel::replayEvents(qint64 rangeStart, qint64 rangeEnd, ...@@ -213,7 +212,7 @@ void QmlProfilerDataModel::replayEvents(qint64 rangeStart, qint64 rangeEnd,
} }
continue; continue;
} else if (event.timestamp() > rangeEnd) { } else if (event.timestamp() > rangeEnd) {
if (type.rangeType != MaximumRangeType) { if (type.rangeType() != MaximumRangeType) {
if (event.rangeStage() == RangeEnd) { if (event.rangeStage() == RangeEnd) {
if (stack.isEmpty()) { if (stack.isEmpty()) {
QmlEvent endEvent(event); QmlEvent endEvent(event);
...@@ -251,7 +250,7 @@ void QmlProfilerDataModel::detailsChanged(int requestId, const QString &newStrin ...@@ -251,7 +250,7 @@ void QmlProfilerDataModel::detailsChanged(int requestId, const QString &newStrin
{ {
Q_D(QmlProfilerDataModel); Q_D(QmlProfilerDataModel);
QTC_ASSERT(requestId < d->eventTypes.count(), return); QTC_ASSERT(requestId < d->eventTypes.count(), return);
d->eventTypes[requestId].data = newString; d->eventTypes[requestId].setData(newString);
} }
} // namespace QmlProfiler } // namespace QmlProfiler
...@@ -193,8 +193,8 @@ QVariantList QmlProfilerRangeModel::labels() const ...@@ -193,8 +193,8 @@ QVariantList QmlProfilerRangeModel::labels() const
for (int i = 1; i < expandedRowCount(); i++) { // Ignore the -1 for the first row for (int i = 1; i < expandedRowCount(); i++) { // Ignore the -1 for the first row
QVariantMap element; QVariantMap element;
int typeId = m_expandedRowTypes[i]; int typeId = m_expandedRowTypes[i];
element.insert(QLatin1String("displayName"), QVariant(types[typeId].displayName)); element.insert(QLatin1String("displayName"), QVariant(types[typeId].displayName()));
element.insert(QLatin1String("description"), QVariant(types[typeId].data)); element.insert(QLatin1String("description"), QVariant(types[typeId].data()));
element.insert(QLatin1String("id"), QVariant(typeId)); element.insert(QLatin1String("id"), QVariant(typeId));
result << element; result << element;
} }
...@@ -212,8 +212,8 @@ QVariantMap QmlProfilerRangeModel::details(int index) const ...@@ -212,8 +212,8 @@ QVariantMap QmlProfilerRangeModel::details(int index) const
tr(QmlProfilerModelManager::featureName(mainFeature()))); tr(QmlProfilerModelManager::featureName(mainFeature())));
result.insert(tr("Duration"), QmlProfilerDataModel::formatTime(duration(index))); result.insert(tr("Duration"), QmlProfilerDataModel::formatTime(duration(index)));
result.insert(tr("Details"), types[id].data); result.insert(tr("Details"), types[id].data());
result.insert(tr("Location"), types[id].displayName); result.insert(tr("Location"), types[id].displayName());
return result; return result;
} }
......
...@@ -207,7 +207,7 @@ void QmlProfilerStatisticsModel::notesChanged(int typeIndex) ...@@ -207,7 +207,7 @@ void QmlProfilerStatisticsModel::notesChanged(int typeIndex)
void QmlProfilerStatisticsModel::loadEvent(const QmlEvent &event, const QmlEventType &type) void QmlProfilerStatisticsModel::loadEvent(const QmlEvent &event, const QmlEventType &type)
{ {
if (!d->acceptedTypes.contains(type.rangeType)) if (!d->acceptedTypes.contains(type.rangeType()))
return; return;
switch (event.rangeStage()) { switch (event.rangeStage()) {
...@@ -215,7 +215,7 @@ void QmlProfilerStatisticsModel::loadEvent(const QmlEvent &event, const QmlEvent ...@@ -215,7 +215,7 @@ void QmlProfilerStatisticsModel::loadEvent(const QmlEvent &event, const QmlEvent
// binding loop detection: check whether event is already in stack // binding loop detection: check whether event is already in stack
for (int ii = 1; ii < d->callStack.size(); ++ii) { for (int ii = 1; ii < d->callStack.size(); ++ii) {
if (d->callStack.at(ii).typeIndex() == event.typeIndex() if (d->callStack.at(ii).typeIndex() == event.typeIndex()
&& type.rangeType != Javascript) { && type.rangeType() != Javascript) {
d->eventsInBindingLoop.insert(event.typeIndex()); d->eventsInBindingLoop.insert(event.typeIndex());
break; break;
} }
......
...@@ -53,15 +53,11 @@ struct Colors { ...@@ -53,15 +53,11 @@ struct Colors {
}; };