QmlProfiler: Don't lie about the debug messages model's row count

The previous code would crash in the renderer if the type id is smaller
than the detail type of the message. That is rare, but can happen.

Change-Id: I7702284bc61a7c9227c7ad81ecf714255db5db9f
Reviewed-by: Michael Winkelmann <Michael.winkelmann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This commit is contained in:
Ulf Hermann
2016-09-13 15:54:20 +02:00
parent 181a17bbdc
commit 0eb1301b5c

View File

@@ -99,7 +99,7 @@ void DebugMessagesModel::loadEvent(const QmlEvent &event, const QmlEventType &ty
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 = type.detailType();
} }
void DebugMessagesModel::finalize() void DebugMessagesModel::finalize()