Add more checks for backwards compatibility

Stop using MaximumXXXType in events where they might be saved into
trace files. It makes older traces incompatible with new traces if
new fields are added since new versions treat them as valid events.
Instead use UndefinedXXXType that doesn't change if new fields are
added.

Add checks for event types greater or equal to MaximumXXXType where
they are missing so that older versions do not process new
unrecognized events.

Fix opening old traces by checking missmatch between quick3d event
and the range type.

Fixes: QTCREATORBUG-28146
Change-Id: I8950da2d636ef1fedf4500916896a9ecae222166
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Antti Määttä
2022-09-26 09:02:16 +03:00
parent 0f49728c32
commit b16d1e2b11
9 changed files with 55 additions and 27 deletions

View File

@@ -154,6 +154,8 @@ int InputEventsModel::collapsedRow(int index) const
void InputEventsModel::loadEvent(const QmlEvent &event, const QmlEventType &type)
{
if (type.detailType() >= MaximumInputEventType)
return;
m_data.insert(insert(event.timestamp(), 0, type.detailType()),
Item(static_cast<InputEventType>(event.number<qint32>(0)),
event.number<qint32>(1), event.number<qint32>(2)));